diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-10-26 17:12:27 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-10-26 17:12:27 +0800 |
commit | 40e0d3595961913aff0405369ddc9cbec2f743d1 (patch) | |
tree | b8f10f6cbe5b9453745545424cca94a18ada6b0c /script | |
parent | c7184a917f20ce386e4c3ac7cbfa3c32d7180358 (diff) | |
download | lua-language-server-40e0d3595961913aff0405369ddc9cbec2f743d1.zip |
fix #753
Diffstat (limited to 'script')
-rw-r--r-- | script/core/hover/return.lua | 7 | ||||
-rw-r--r-- | script/core/infer.lua | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/script/core/hover/return.lua b/script/core/hover/return.lua index 0f0d85e0..49f9536a 100644 --- a/script/core/hover/return.lua +++ b/script/core/hover/return.lua @@ -54,6 +54,13 @@ local function asFunction(source) line[#line+1] = ('% 3d. '):format(i) end for n = 1, #rtn do + if rtn[n].type == 'doc.type' then + for _, typeUnit in ipairs(rtn[n].types) do + if typeUnit[1] == 'nil' then + infers['nil'] = true + end + end + end local values = infer.searchInfers(rtn[n]) for tp in pairs(values) do infers[tp] = true diff --git a/script/core/infer.lua b/script/core/infer.lua index ab297209..6e667e65 100644 --- a/script/core/infer.lua +++ b/script/core/infer.lua @@ -216,7 +216,6 @@ local function searchLiteralOfValue(value, literals, mark) end end end - return end local function bindClassOrType(source) |