diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-11-30 13:35:06 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-11-30 13:35:06 +0800 |
commit | 5036feacb75692b13cf80949aa701bfc360bc6d3 (patch) | |
tree | 558de174e769cafd8c094baf2c0b7dcc6326329a /server | |
parent | 5bcbdd90df6b75464870df8dbd793c207a4ed153 (diff) | |
download | lua-language-server-5036feacb75692b13cf80949aa701bfc360bc6d3.zip |
支持非name的field
Diffstat (limited to 'server')
-rw-r--r-- | server/src/matcher/definition.lua | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/server/src/matcher/definition.lua b/server/src/matcher/definition.lua index cea737b3..08c37a43 100644 --- a/server/src/matcher/definition.lua +++ b/server/src/matcher/definition.lua @@ -127,7 +127,7 @@ function mt:searchSimple(simple) else if obj.index then var = self:getField(var, obj[1]) - self:searchExp(obj) + self:checkVar(var, obj) else var = nil end @@ -191,10 +191,23 @@ function mt:markSimple(simple) if tp == ':' then self:createLocal('self', obj) elseif tp == 'name' then - var = self:addField(var, obj[1], { - type = 'field', - source = obj, - }) + if not obj.index then + var = self:addField(var, obj[1], { + type = 'field', + source = obj, + }) + else + var = nil + end + else + if obj.index then + var = self:addField(var, obj[1], { + type = 'field', + source = obj, + }) + else + var = nil + end end end end |