summaryrefslogtreecommitdiff
path: root/server/src/matcher/hover.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-21 10:59:38 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-21 10:59:38 +0800
commitdedd889cb24357a443d4991eae6cb25e4fd830d6 (patch)
tree5407ad6e6255b486c45a27c1a11402f7d7fd4fce /server/src/matcher/hover.lua
parent3e7c5d5725e2a342121b8758a5e364dcf9f6435d (diff)
downloadlua-language-server-dedd889cb24357a443d4991eae6cb25e4fd830d6.zip
修正报错
Diffstat (limited to 'server/src/matcher/hover.lua')
-rw-r--r--server/src/matcher/hover.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/src/matcher/hover.lua b/server/src/matcher/hover.lua
index a2ced9fe..bfaead9a 100644
--- a/server/src/matcher/hover.lua
+++ b/server/src/matcher/hover.lua
@@ -1,4 +1,3 @@
-local findResult = require 'matcher.find_result'
local findLib = require 'matcher.find_lib'
local OriginTypes = {
@@ -249,8 +248,10 @@ local function buildValueReturns(result)
return ''
end
local strs = {}
- for i, rtn in ipairs(func.returns) do
- strs[i] = rtn.type
+ if func.returns then
+ for i, rtn in ipairs(func.returns) do
+ strs[i] = rtn.type
+ end
end
if #strs == 0 then
strs[1] = 'any'