summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-11-30 13:44:45 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-11-30 13:44:45 +0800
commit2afd196a57e5e2de15fb9fa6ab9a836f26ddb87a (patch)
treeadcb4d6f0f597d1a7ff9e4b5592639cdef4b2497 /server/src
parent5036feacb75692b13cf80949aa701bfc360bc6d3 (diff)
downloadlua-language-server-2afd196a57e5e2de15fb9fa6ab9a836f26ddb87a.zip
支持索引里的表达式
Diffstat (limited to 'server/src')
-rw-r--r--server/src/matcher/definition.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/src/matcher/definition.lua b/server/src/matcher/definition.lua
index 08c37a43..12139e62 100644
--- a/server/src/matcher/definition.lua
+++ b/server/src/matcher/definition.lua
@@ -72,7 +72,7 @@ function mt:getField(parent, key)
end
function mt:checkVar(var, source)
- if not source then
+ if not var or not source then
return
end
if self:isContainPos(source) then
@@ -118,11 +118,12 @@ function mt:searchSimple(simple)
if tp == 'call' then
self:searchCall(obj)
elseif tp == 'name' then
- if not obj.index then
+ if obj.index then
+ var = nil
+ self:searchExp(obj)
+ else
var = self:getField(var, obj[1])
self:checkVar(var, obj)
- else
- var = nil
end
else
if obj.index then