summaryrefslogtreecommitdiff
path: root/server/src/core/hover/emmy_function.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-10-21 21:51:09 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-10-21 21:51:09 +0800
commite9728bdbafa7d93bf1f017ab5835ad84890604fc (patch)
tree7c042e9837b217a7d064797fb6385f131a2fee66 /server/src/core/hover/emmy_function.lua
parent079847053a3020600a9fd0c35e12a9f7e8d57f16 (diff)
downloadlua-language-server-e9728bdbafa7d93bf1f017ab5835ad84890604fc.zip
#101 在多返回值前面加上序号
Diffstat (limited to 'server/src/core/hover/emmy_function.lua')
-rw-r--r--server/src/core/hover/emmy_function.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/src/core/hover/emmy_function.lua b/server/src/core/hover/emmy_function.lua
index 37b44a79..7c87954e 100644
--- a/server/src/core/hover/emmy_function.lua
+++ b/server/src/core/hover/emmy_function.lua
@@ -47,13 +47,18 @@ end
local function buildEmmyReturns(emmy)
local rtns = {}
+ local i = 0
emmy:eachReturn(function (rtn)
+ i = i + 1
+ if i > 1 then
+ rtns[#rtns+1] = ('\n% 3d. '):format(i)
+ end
rtns[#rtns+1] = rtn:getType()
end)
if #rtns == 0 then
return '\n -> ' .. 'any'
else
- return '\n -> ' .. table.concat(rtns, ', ')
+ return '\n -> ' .. table.concat(rtns)
end
end