summaryrefslogtreecommitdiff
path: root/script/vm/compiler.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-26 01:31:45 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-26 01:31:45 +0800
commitc78fbf09aa4406db905a8a0e6dd5731871f2c262 (patch)
tree50d1c7005f1ab879608a5738d626370e1a01ac70 /script/vm/compiler.lua
parented64703ef9fec2b1c6736a0deb68bd567875a654 (diff)
downloadlua-language-server-c78fbf09aa4406db905a8a0e6dd5731871f2c262.zip
#1207
return names and parentheses can be used in `DocFunction`
Diffstat (limited to 'script/vm/compiler.lua')
-rw-r--r--script/vm/compiler.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index 00c8170c..46f6d0e9 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -479,7 +479,12 @@ function vm.getReturnOfFunction(func, index)
if func.type == 'doc.type.function' then
local rtn = func.returns[index]
if not rtn then
- return nil
+ local lastReturn = func.returns[#func.returns]
+ if lastReturn and lastReturn.name and lastReturn.name[1] == '...' then
+ rtn = lastReturn
+ else
+ return nil
+ end
end
local sign = getObjectSign(func)
if not sign then