File tree Expand file tree Collapse file tree 3 files changed +29
-2
lines changed
Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 11# changelog
22
33## 3.6.26
4+ * ` FIX ` wrong hover and signature for method with varargs and overloads
45* ` FIX ` [ #2224 ]
56
67[ #2224 ] : https://github.com/LuaLS/lua-language-server/issues/2224
Original file line number Diff line number Diff line change @@ -372,8 +372,14 @@ function vm.isVarargFunctionWithOverloads(func)
372372 if not func .args then
373373 return false
374374 end
375- if not func .args [1 ] or func .args [1 ].type ~= ' ...' then
376- return false
375+ if func .args [1 ] and func .args [1 ].type == ' self' then
376+ if not func .args [2 ] or func .args [2 ].type ~= ' ...' then
377+ return false
378+ end
379+ else
380+ if not func .args [1 ] or func .args [1 ].type ~= ' ...' then
381+ return false
382+ end
377383 end
378384 if not func .bindDocs then
379385 return false
Original file line number Diff line number Diff line change @@ -1695,6 +1695,26 @@ function f(x: number, y: number)
16951695```]]
16961696}
16971697
1698+ TEST { { path = ' a.lua' , content = [[
1699+ ---@overload fun(self: self, x: number)
1700+ ---@overload fun(self: self, x: number, y: number)
1701+ function M:f(...)
1702+ end
1703+
1704+ M:<?f?>
1705+ ]] },
1706+ hover = [[
1707+ ```lua
1708+ (method) M:f(x: number)
1709+ ```
1710+
1711+ ---
1712+
1713+ ```lua
1714+ (method) M:f(x: number, y: number)
1715+ ```]]
1716+ }
1717+
16981718TEST { {path = ' a.lua' , content = [[
16991719---@class A
17001720
You can’t perform that action at this time.
0 commit comments