summaryrefslogtreecommitdiff
path: root/test/crossfile
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-10-20 20:49:11 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-10-20 20:49:11 +0800
commit0c7a22d1106cd97b47cb969e2ccfd86ca7ae2629 (patch)
tree28be218460604922063a2ca9af44f270e77e1c78 /test/crossfile
parent1c79bbc9d1a238e4cc900c506690e52f8e5f12f2 (diff)
downloadlua-language-server-0c7a22d1106cd97b47cb969e2ccfd86ca7ae2629.zip
ignore varargs
if a function only has varargs and has `---@overload`, the varargs will be ignored resolve #1641
Diffstat (limited to 'test/crossfile')
-rw-r--r--test/crossfile/hover.lua38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua
index c3d7078c..6d1f3df6 100644
--- a/test/crossfile/hover.lua
+++ b/test/crossfile/hover.lua
@@ -1606,3 +1606,41 @@ someType:
| "#" -- description
```]]
}
+
+TEST { { path = 'a.lua', content = [[
+---@overload fun(x: number)
+---@overload fun(x: number, y: number)
+local function <?f?>(...)
+end
+]] },
+hover = [[
+```lua
+function f(x: number)
+```
+
+---
+
+```lua
+function f(x: number, y: number)
+```]]
+}
+
+TEST { { path = 'a.lua', content = [[
+---@overload fun(x: number)
+---@overload fun(x: number, y: number)
+local function f(...)
+end
+
+<?f?>
+]] },
+hover = [[
+```lua
+function f(x: number)
+```
+
+---
+
+```lua
+function f(x: number, y: number)
+```]]
+}