diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-10-31 14:13:53 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-10-31 14:13:53 +0800 |
commit | ea065efb34ad658030335164bc6b2a4266b34347 (patch) | |
tree | 75e446fd8f32394d147e9657b9fb9d80b9b858b4 /script-beta/core | |
parent | 66f0bedc723d07ef6527f28fff76e7cbc46d9e2e (diff) | |
download | lua-language-server-ea065efb34ad658030335164bc6b2a4266b34347.zip |
hover支持 overload
Diffstat (limited to 'script-beta/core')
-rw-r--r-- | script-beta/core/hover/init.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/script-beta/core/hover/init.lua b/script-beta/core/hover/init.lua index 5e7a4072..d0873c98 100644 --- a/script-beta/core/hover/init.lua +++ b/script-beta/core/hover/init.lua @@ -8,7 +8,7 @@ local findSource = require 'core.find-source' local lang = require 'language' local function getHoverAsFunction(source) - local values = vm.getInfers(source, 'deep') + local values = vm.getDefs(source, 'deep') local desc = getDesc(source) local labels = {} local defs = 0 @@ -18,8 +18,9 @@ local function getHoverAsFunction(source) or source.type == 'getmethod' or source.type == 'setmethod' for _, value in ipairs(values) do - if value.type == 'function' then - local label = getLabel(value.source, oop) + if value.type == 'function' + or value.type == 'doc.type.function' then + local label = getLabel(value, oop) if label then defs = defs + 1 labels[label] = (labels[label] or 0) + 1 |