diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-19 21:12:38 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-19 21:12:38 +0800 |
commit | eb96b02d0e37bf0bd1da37704089683d200981c3 (patch) | |
tree | dfd17bfc850f0b5d7f3c92afd2ec7102ccb0edc8 /meta/template/debug.lua | |
parent | e9a96590fafd4ab39c71294b48e808739553187e (diff) | |
download | lua-language-server-eb96b02d0e37bf0bd1da37704089683d200981c3.zip |
更新meta
Diffstat (limited to 'meta/template/debug.lua')
-rw-r--r-- | meta/template/debug.lua | 96 |
1 files changed, 77 insertions, 19 deletions
diff --git a/meta/template/debug.lua b/meta/template/debug.lua index 0f360eb5..6c010c0f 100644 --- a/meta/template/debug.lua +++ b/meta/template/debug.lua @@ -1,5 +1,6 @@ ---@meta +---#DES 'debug' ---@class debug* debug = {} @@ -14,19 +15,27 @@ debug = {} ---@field currentline integer ---@field istailcall boolean ---@field nups integer +---#if VERSION >= 5.2 then ---@field nparams integer ---@field isvararg boolean +---#endif ---@field func function +---#if VERSION >= 5.4 then ---@field ftransfer integer ---@field ntransfer integer +---#endif ---@field activelines table +---#DES 'debug.debug' function debug.debug() end +---@version 5.1 +---#DES 'debug.getfenv' ---@param o any ---@return table function debug.getfenv(o) end +---#DES 'debug.gethook' ---@param co? thread ---@return function hook ---@return string mask @@ -34,15 +43,22 @@ function debug.getfenv(o) end function debug.gethook(co) end ---@alias infowhat string ----|+'"n"' # `name` 和 `namewhat` ----|+'"S"' # `source`,`short_src`,`linedefined`,`lalinedefined`,和 `what` ----|+'"l"' # `currentline` ----|+'"t"' # `istailcall` ----|+'"u"' # `nups`,`nparams` 和 `isvararg` ----|+'"f"' # `func` ----|+'"r"' # `ftransfer` 和 `ntransfer` ----|+'"L"' # `activelines` - +---|+'"n"' # ---#DESENUM 'infowhat.n' +---|+'"S"' # ---#DESENUM 'infowhat.S' +---|+'"l"' # ---#DESENUM 'infowhat.l' +---|+'"t"' # ---#DESENUM 'infowhat.t' +---#if VERSION <= 5.1 then +---|+'"u<5.1"' # ---#DESENUM 'infowhat.u<5.1' +---#else +---|+'"u>5.2"' # ---#DESENUM 'infowhat.u>5.2' +---#end +---|+'"f"' # ---#DESENUM 'infowhat.f' +---#if VERSION >= 5.4 then +---|+'"r"' # ---#DESENUM 'infowhat.r' +---#endif +---|+'"L"' # ---#DESENUM 'infowhat.L' + +---#DES 'debug.getinfo' ---@overload fun(f: integer|function, what?: infowhat):debuginfo ---@param thread thread ---@param f integer|function @@ -50,38 +66,62 @@ function debug.gethook(co) end ---@return debuginfo function debug.getinfo(thread, f, what) end +---#DES 'debug.getlocal<5.1' +---@overload fun(level: integer, index: integer):string, any +---@param thread thread +---@param level integer +---@param index integer +---@return string name +---@return any value +function debug.getlocal(thread, level, index) end + +---#DES 'debug.getlocal>5.2' ---@overload fun(f: integer|function, index: integer):string, any ----@param thread thread ----@param f integer|function ----@param index integer +---@param thread thread +---@param f integer|function +---@param index integer ---@return string name ----@return any value +---@return any value function debug.getlocal(thread, f, index) end +---#DES 'debug.getmetatable' ---@param object any ---@return table metatable function debug.getmetatable(object) end +---#DES 'debug.getregistry' ---@return table function debug.getregistry() end ----@param f integer|function +---#DES 'debug.getupvalue' +---@param f function ---@param up integer ---@return string name ----@return any value +---@return any value function debug.getupvalue(f, up) end +---#if VERSION >= 5.4 then +---#DES 'debug.getuservalue>5.4' ---@param u userdata ---@param n integer ---@return any ---@return boolean function debug.getuservalue(u, n) end +---#else +---#DES 'debug.getuservalue<5.3' +---@param u userdata +---@return any +function debug.getuservalue(u) end +---#endif +---#DES 'debug.setcstacklimit' ---@deprecated ---@param limit integer ---@return integer|boolean function debug.setcstacklimit(limit) end +---#DES 'debug.setfenv' +---@version 5.1 ---@generic T ---@param object T ---@param env table @@ -89,10 +129,11 @@ function debug.setcstacklimit(limit) end function debug.setfenv(object, env) end ---@alias hookmask string ----|+'"c"' ----|+'"r"' ----|+'"l"' +---|+'"c"' # ---#DESENUM 'hookmask.c' +---|+'"r"' # ---#DESENUM 'hookmask.r' +---|+'"l"' # ---#DESENUM 'hookmask.l' +---#DES 'debug.sethook' ---@overload fun(hook: function, mask: hookmask, count?: integer) ---@param thread thread ---@param hook function @@ -100,6 +141,7 @@ function debug.setfenv(object, env) end ---@param count? integer function debug.sethook(thread, hook, mask, count) end +---#DES 'debug.setlocal' ---@overload fun(level: integer, index: integer, value: any):string ---@param thread thread ---@param level integer @@ -108,35 +150,51 @@ function debug.sethook(thread, hook, mask, count) end ---@return string name function debug.setlocal(thread, level, index, value) end +---#DES 'debug.setmetatable' ---@generic T ---@param value T ---@param meta table ---@return T value function debug.setmetatable(value, meta) end +---#DES 'debug.setupvalue' ---@param f function ---@param up integer ---@param value any ---@return string name function debug.setupvalue(f, up, value) end +---#if VERSION >= 5.4 then +---#DES 'debug.setuservalue>5.4' ---@param udata userdata ---@param value any ---@param n integer ---@return userdata udata function debug.setuservalue(udata, value, n) end +---#else +---#DES 'debug.setuservalue<5.3' +---@param udata userdata +---@param value any +---@return userdata udata +function debug.setuservalue(udata, value) end +---#end +---#DES 'debug.traceback' ---@param thread thread ---@param message? any ---@param level? integer ----@return string message +---@return string message function debug.traceback(thread, message, level) end +---@version >5.2 +---#DES 'debug.upvalueid' ---@param f function ---@param n integer ---@return lightuserdata id function debug.upvalueid(f, n) end +---@version >5.2 +---#DES 'debug.upvaluejoin' ---@param f1 function ---@param n1 integer ---@param f2 function |