summaryrefslogtreecommitdiff
path: root/server/src/matcher/hover.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-14 16:54:13 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-14 16:54:13 +0800
commit657c25016e7c76012e21ff0729cd6c3bd6703ee5 (patch)
tree041db8338d795d8f41edd21bf6d03253221ec24e /server/src/matcher/hover.lua
parent8860d1a77c820e017ee82d6ba9ce2ff2b8d90e8b (diff)
downloadlua-language-server-657c25016e7c76012e21ff0729cd6c3bd6703ee5.zip
修正一个报错
Diffstat (limited to 'server/src/matcher/hover.lua')
-rw-r--r--server/src/matcher/hover.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/src/matcher/hover.lua b/server/src/matcher/hover.lua
index b4430b02..b997e8f8 100644
--- a/server/src/matcher/hover.lua
+++ b/server/src/matcher/hover.lua
@@ -145,6 +145,11 @@ local function buildValueName(result, source)
end
local parentName = declarat.parentName
+
+ if not parentName then
+ return result.key or ''
+ end
+
if parentName == '?' then
local parentType = result.parentValue and result.parentValue.type
if parentType == 'table' then