summaryrefslogtreecommitdiff
path: root/test/crossfile
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-26 01:42:35 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-26 01:42:35 +0800
commitfc4e8ef687ad996f96091c664c6a9110dd087a5d (patch)
tree83f6d2e7fcf63e6b45d94a1d8127efd3d0d22f65 /test/crossfile
parentc78fbf09aa4406db905a8a0e6dd5731871f2c262 (diff)
downloadlua-language-server-fc4e8ef687ad996f96091c664c6a9110dd087a5d.zip
#1207 split `...(param)` and `...(return)`
displayed in enums of hover
Diffstat (limited to 'test/crossfile')
-rw-r--r--test/crossfile/hover.lua39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua
index c6991d8f..827c440c 100644
--- a/test/crossfile/hover.lua
+++ b/test/crossfile/hover.lua
@@ -1181,3 +1181,42 @@ function f(x: number, y: number, ...: number)
3. ...number
```]]
}
+
+TEST {
+ {
+ path = 'a.lua',
+ content = [[
+ ---@param p 'a1' | 'a2'
+ ---@param ... 'a3' | 'a4'
+ ---@return 'r1' | 'r2' ret1
+ ---@return 'r3' | 'r4' ...
+ local function <?f?>(p, ...) end
+ ]]
+ },
+ hover = [[
+```lua
+function f(p: 'a1'|'a2', ...'a3'|'a4')
+ -> ret1: 'r1'|'r2'
+ 2. ...'r3'|'r4'
+```
+
+---
+
+```lua
+p:
+ | 'a1'
+ | 'a2'
+
+...(param):
+ | 'a3'
+ | 'a4'
+
+ret1:
+ | 'r1'
+ | 'r2'
+
+...(return):
+ | 'r3'
+ | 'r4'
+```]]
+}