diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-26 10:28:18 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-26 10:28:18 +0800 |
commit | e9bb594f37a5f28a984a81211d572c39aa68b728 (patch) | |
tree | ccc99c2be2d39e5d8d6e411a8c10f6d35900a8de /server/src | |
parent | 712347eb8a31ae0b8e6cc1c96fd7f75d152f0719 (diff) | |
download | lua-language-server-e9bb594f37a5f28a984a81211d572c39aa68b728.zip |
修正报错
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/matcher/hover.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/server/src/matcher/hover.lua b/server/src/matcher/hover.lua index e34bec69..d2e7dd9c 100644 --- a/server/src/matcher/hover.lua +++ b/server/src/matcher/hover.lua @@ -406,7 +406,14 @@ return function (result, source, lsp, select) end local lib, fullKey, oo = findLib(result) - local valueType = lib and lib.type or result.value.type or 'nil' + local valueType = lib and lib.type + if valueType then + if type(valueType) == 'table' then + valueType = valueType[1] + end + else + valueType = result.value.type or 'nil' + end local name = fullKey or buildValueName(result, source) if valueType == 'function' then return getFunctionHover(name, result, source, lib, oo, select) |