diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-01-07 13:38:46 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-01-07 13:38:46 +0800 |
commit | 5b1886a9cfa7c8dc1947bf7bb19e9fd3d04d604d (patch) | |
tree | 6e779e13ecd76caef500650161fad3e4b345df6a /server/src/core | |
parent | 0e663b24ca12cd47a9a3d308fb0732f7f4b4b2e8 (diff) | |
download | lua-language-server-5b1886a9cfa7c8dc1947bf7bb19e9fd3d04d604d.zip |
记录Simple中的点与冒号
Diffstat (limited to 'server/src/core')
-rw-r--r-- | server/src/core/completion.lua | 1 | ||||
-rw-r--r-- | server/src/core/vm.lua | 31 |
2 files changed, 17 insertions, 15 deletions
diff --git a/server/src/core/completion.lua b/server/src/core/completion.lua index 8fe3888e..34409bd5 100644 --- a/server/src/core/completion.lua +++ b/server/src/core/completion.lua @@ -334,6 +334,7 @@ local function findClosePos(vm, pos) type = 'name', start = pos, finish = pos, + object = parent.source.colon and parent, [1] = '', } local result = { diff --git a/server/src/core/vm.lua b/server/src/core/vm.lua index 549fdc80..290125f1 100644 --- a/server/src/core/vm.lua +++ b/server/src/core/vm.lua @@ -1008,22 +1008,23 @@ function mt:getSimple(simple, mode) else parentName = ('%s[?]'):format(parentName) end - else - if tp == 'name' then - field = self:getField(value, obj[1], obj) - field.parentValue = value - value = self:getValue(field) - if mode == 'value' or i < #simple then - self:addInfo(field, 'get', obj) - end - field.parent = lastField - lastField = field - obj.object = object - obj.parentName = parentName - parentName = parentName .. '.' .. field.key - elseif tp == ':' then - object = field + elseif tp == 'name' then + field = self:getField(value, obj[1], obj) + field.parentValue = value + value = self:getValue(field) + if mode == 'value' or i < #simple then + self:addInfo(field, 'get', obj) end + field.parent = lastField + lastField = field + obj.object = object + obj.parentName = parentName + parentName = parentName .. '.' .. field.key + elseif tp == ':' then + object = field + field.source.colon = obj + elseif tp == '.' then + field.source.dot = obj end end if mode == 'value' then |