summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-10-21 15:52:55 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-10-21 15:52:55 +0800
commit49566afd015200c867f673dbe04f97dc241cc4be (patch)
treeaf843eaeb29e67d06784c42d664807561c344a36 /server
parentdcf3a0fc15d3c96fbded3960d9bc56a4dc93f737 (diff)
downloadlua-language-server-49566afd015200c867f673dbe04f97dc241cc4be.zip
#101 函数多返回值换行
Diffstat (limited to 'server')
-rw-r--r--server/src/core/hover/function.lua2
-rw-r--r--server/src/core/hover/lib_function.lua2
-rw-r--r--server/test/hover/init.lua19
3 files changed, 15 insertions, 8 deletions
diff --git a/server/src/core/hover/function.lua b/server/src/core/hover/function.lua
index 25849d69..df26cd40 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] = ', '
+ strs[#strs+1] = '\n , '
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 96ed0f5e..09b1e47b 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] = ', '
+ strs[#strs+1] = '\n , '
end
if rtn.name then
strs[#strs+1] = ('%s: '):format(rtn.name)
diff --git a/server/test/hover/init.lua b/server/test/hover/init.lua
index b9bcc0fc..3a4c05b1 100644
--- a/server/test/hover/init.lua
+++ b/server/test/hover/init.lua
@@ -189,7 +189,8 @@ TEST [[
]]
[=[
function load(chunk: string/function [, chunkname: string [, mode: string [, env: table]]])
- -> function, error_message: string
+ -> function
+ , error_message: string
]=]
TEST [[
@@ -454,7 +455,8 @@ TEST[[
]]
[[
function next(table: table [, index: any])
- -> key: any, value: any
+ -> key: any
+ , value: any
]]
TEST[[
@@ -462,7 +464,8 @@ local <?n?> = pairs()
]]
[[
function n<next>(table: table [, index: any])
- -> key: any, value: any
+ -> key: any
+ , value: any
]]
TEST[[
@@ -611,7 +614,8 @@ end
]]
[[
function f()
- -> A|B, C
+ -> A|B
+ , C
]]
TEST [[
@@ -856,7 +860,8 @@ function <?f?>() end
]]
[=[
function f()
- -> key: string, value: string
+ -> key: string
+ , value: string
]=]
TEST [[
@@ -867,7 +872,9 @@ function <?f?>() end
]]
[=[
function f()
- -> [x: any [, y: string], z: string]
+ -> [x: any [
+ , y: string]
+ , z: string]
]=]
TEST [[