diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-26 01:31:45 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-26 01:31:45 +0800 |
commit | c78fbf09aa4406db905a8a0e6dd5731871f2c262 (patch) | |
tree | 50d1c7005f1ab879608a5738d626370e1a01ac70 /script/vm/compiler.lua | |
parent | ed64703ef9fec2b1c6736a0deb68bd567875a654 (diff) | |
download | lua-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.lua | 7 |
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 |