diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-03-30 02:53:15 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-03-30 02:53:15 +0800 |
commit | 19e1709f0d53975fa0e752cb64c0c47e3c48bedf (patch) | |
tree | c0d76532499682ab3d57da6c83229c3fd21270de | |
parent | 635b266a9188cf87ae856a21308347c113c52250 (diff) | |
download | lua-language-server-19e1709f0d53975fa0e752cb64c0c47e3c48bedf.zip |
update
-rw-r--r-- | meta/template/basic.lua | 4 | ||||
-rw-r--r-- | meta/template/table.lua | 4 | ||||
-rw-r--r-- | script/parser/luadoc.lua | 13 | ||||
-rw-r--r-- | test/hover/init.lua | 8 |
4 files changed, 10 insertions, 19 deletions
diff --git a/meta/template/basic.lua b/meta/template/basic.lua index 980b3dc1..31b10bd1 100644 --- a/meta/template/basic.lua +++ b/meta/template/basic.lua @@ -274,8 +274,10 @@ function xpcall(f, msgh, arg1, ...) end ---@version 5.1 ---#DES 'unpack' ----@param list table +---@generic T +---@param list T[] ---@param i? integer ---@param j? integer +---@return T ---@nodiscard function unpack(list, i, j) end diff --git a/meta/template/table.lua b/meta/template/table.lua index c55c3160..3ec92ce8 100644 --- a/meta/template/table.lua +++ b/meta/template/table.lua @@ -56,9 +56,11 @@ function table.sort(list, comp) end ---@version >5.2, JIT ---#DES 'table.unpack' ----@param list table +---@generic T +---@param list T[] ---@param i? integer ---@param j? integer +---@return T ---@nodiscard function table.unpack(list, i, j) end diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua index cfde757b..4dbece5a 100644 --- a/script/parser/luadoc.lua +++ b/script/parser/luadoc.lua @@ -627,19 +627,6 @@ local function parseResume(parent) result.additional = additional end - local tp = peekToken() - if tp ~= 'string' then - pushWarning { - type = 'LUADOC_MISS_STRING', - start = getFinish(), - finish = getFinish(), - } - return nil - end - local _, str = nextToken() - result[1] = str - result.start = getStart() - result.finish = getFinish() return result end diff --git a/test/hover/init.lua b/test/hover/init.lua index 9cb24d3d..1493dfd9 100644 --- a/test/hover/init.lua +++ b/test/hover/init.lua @@ -311,7 +311,7 @@ end ]] [[ function x() - -> any + -> unknown ]] TEST [[ @@ -367,19 +367,19 @@ local function f() end local <?n?> = f() ]] -[[local n: any]] +[[local n: unknown]] TEST [[ local <?n?> = table.unpack(t) ]] -[[local n: any]] +[[local n: unknown]] TEST [[ local <?n?> table.pack(n) ]] [[ -local n: any +local n: unknown ]] TEST [[ |