summaryrefslogtreecommitdiff
path: root/server/src/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-06-29 15:27:38 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-06-29 15:27:38 +0800
commitf0bfb047bfb81b6f11400939ad736b7267e08938 (patch)
tree2b4d706f82485164363987bc9740d0ebd92787f8 /server/src/core
parent4586d62c06751d99199044375393dc1595375491 (diff)
downloadlua-language-server-f0bfb047bfb81b6f11400939ad736b7267e08938.zip
emmyfunction 支持多返回值
Diffstat (limited to 'server/src/core')
-rw-r--r--server/src/core/hover/emmy_function.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/server/src/core/hover/emmy_function.lua b/server/src/core/hover/emmy_function.lua
index 313b5276..4dd89107 100644
--- a/server/src/core/hover/emmy_function.lua
+++ b/server/src/core/hover/emmy_function.lua
@@ -41,11 +41,14 @@ local function buildEmmyArgs(emmy, object, select)
end
local function buildEmmyReturns(emmy)
- local rtn = emmy:getReturn()
- if rtn then
- return '\n -> ' .. rtn:getType()
- else
+ local rtns = {}
+ emmy:eachReturn(function (rtn)
+ rtns[#rtns+1] = rtn:getType()
+ end)
+ if #rtns == 0 then
return '\n -> ' .. 'any'
+ else
+ return '\n -> ' .. table.concat(rtns, ', ')
end
end