summaryrefslogtreecommitdiff
path: root/script/core/hover/init.lua
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 /script/core/hover/init.lua
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 'script/core/hover/init.lua')
-rw-r--r--script/core/hover/init.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/script/core/hover/init.lua b/script/core/hover/init.lua
index 5a65cbce..61f09455 100644
--- a/script/core/hover/init.lua
+++ b/script/core/hover/init.lua
@@ -60,8 +60,12 @@ local function getHover(source)
if guide.isOOP(def) then
oop = true
end
- if def.type == 'function'
- or def.type == 'doc.type.function' then
+ if def.type == 'function'
+ and not vm.isVarargFunctionWithOverloads(def) then
+ hasFunc = true
+ addHover(def, true, oop)
+ end
+ if def.type == 'doc.type.function' then
hasFunc = true
addHover(def, true, oop)
end