diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-10-21 21:51:09 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-10-21 21:51:09 +0800 |
commit | e9728bdbafa7d93bf1f017ab5835ad84890604fc (patch) | |
tree | 7c042e9837b217a7d064797fb6385f131a2fee66 /server | |
parent | 079847053a3020600a9fd0c35e12a9f7e8d57f16 (diff) | |
download | lua-language-server-e9728bdbafa7d93bf1f017ab5835ad84890604fc.zip |
#101 在多返回值前面加上序号
Diffstat (limited to 'server')
-rw-r--r-- | server/src/core/hover/emmy_function.lua | 7 | ||||
-rw-r--r-- | server/src/core/hover/function.lua | 2 | ||||
-rw-r--r-- | server/src/core/hover/lib_function.lua | 2 |
3 files changed, 8 insertions, 3 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 diff --git a/server/src/core/hover/function.lua b/server/src/core/hover/function.lua index 8796be57..3865f602 100644 --- a/server/src/core/hover/function.lua +++ b/server/src/core/hover/function.lua @@ -126,7 +126,7 @@ local function buildValueReturns(func) end end if i > 1 then - strs[#strs+1] = '\n , ' + strs[#strs+1] = ('\n% 3d. '):format(i) end if emmy and emmy.name then strs[#strs+1] = ('%s: '):format(emmy.name) diff --git a/server/src/core/hover/lib_function.lua b/server/src/core/hover/lib_function.lua index bd9cddaa..06087312 100644 --- a/server/src/core/hover/lib_function.lua +++ b/server/src/core/hover/lib_function.lua @@ -92,7 +92,7 @@ local function buildLibReturns(lib) end end if i > 1 then - strs[#strs+1] = '\n , ' + strs[#strs+1] = ('\n% 3d. '):format(i) end if rtn.name then strs[#strs+1] = ('%s: '):format(rtn.name) |