summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-08-09 16:30:21 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-08-09 16:30:21 +0800
commit91869bc5f447dc07ecc78695852e719c67af9b85 (patch)
tree3a3de998fc2d6965e4cc6aad74007b5912e55958 /script/vm
parentb96ab075f43e04d5bb42566df4f7c172b35a3df8 (diff)
downloadlua-language-server-91869bc5f447dc07ecc78695852e719c67af9b85.zip
fix wrong hover and signature for method
with varargs and overloads
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/function.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/script/vm/function.lua b/script/vm/function.lua
index bdd7e229..c6df6349 100644
--- a/script/vm/function.lua
+++ b/script/vm/function.lua
@@ -372,8 +372,14 @@ function vm.isVarargFunctionWithOverloads(func)
if not func.args then
return false
end
- if not func.args[1] or func.args[1].type ~= '...' then
- return false
+ if func.args[1] and func.args[1].type == 'self' then
+ if not func.args[2] or func.args[2].type ~= '...' then
+ return false
+ end
+ else
+ if not func.args[1] or func.args[1].type ~= '...' then
+ return false
+ end
end
if not func.bindDocs then
return false