diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-03-30 15:55:07 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-03-30 15:55:07 +0800 |
commit | dac81ea089eb6970c81859ff2a0bb233f3eb159f (patch) | |
tree | 06a698d55baf7345245e9718eae175115cfbdd7f | |
parent | 763fc5cc9554ae26d364d4080b070596428bc51a (diff) | |
download | lua-language-server-dac81ea089eb6970c81859ff2a0bb233f3eb159f.zip |
load,loadfile,pairs,ipairs返回值的特殊处理
-rw-r--r-- | server/libs/lua53/basic.lni | 30 | ||||
-rw-r--r-- | server/test/diagnostics/init.lua | 5 |
2 files changed, 35 insertions, 0 deletions
diff --git a/server/libs/lua53/basic.lni b/server/libs/lua53/basic.lni index 183ec5e8..929a8ea4 100644 --- a/server/libs/lua53/basic.lni +++ b/server/libs/lua53/basic.lni @@ -80,6 +80,16 @@ type = 'table' [[.returns]] name = 'iterator' type = 'function' +args = { + 1 = { + name = 'table', + type = 'table', + }, + 2 = { + name = 'i', + type = 'integer', + } +} returns = { 1 = { name = 'i', @@ -115,6 +125,11 @@ type = 'table' optional = 'self' [[.returns]] type = 'function' +args = { + 1 = { + type = '...' + }, +} [[.returns]] name = 'error_message' type = 'string' @@ -145,6 +160,11 @@ type = 'table' optional = 'self' [[.returns]] type = 'function' +args = { + 1 = { + type = '...' + }, +} [[.returns]] name = 'error_message' type = 'string' @@ -178,6 +198,16 @@ type = 'table' [[.returns]] name = 'next' type = 'function' +args = { + 1 = { + name = 'table', + type = 'table', + }, + 2 = { + name = 'index', + optional = 'self', + }, +} returns = { 1 = { name = 'key', diff --git a/server/test/diagnostics/init.lua b/server/test/diagnostics/init.lua index 8c7c624d..f1efca70 100644 --- a/server/test/diagnostics/init.lua +++ b/server/test/diagnostics/init.lua @@ -241,3 +241,8 @@ TEST [[ tostring = 1 ROOT = 1 ]] + +TEST [[ +local f = load('') +f(1, 2, 3) +]]
\ No newline at end of file |