diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-03-01 16:07:17 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-03-01 16:07:17 +0800 |
commit | caed96510b21d6bdd9e1c4a175be7486c8c8ff5c (patch) | |
tree | e74dc1d03c9d90d360db75feb0015db19e9a34fe /server/src | |
parent | 302526e4311cb7f54b327d7bdd999a2e60f89eba (diff) | |
download | lua-language-server-caed96510b21d6bdd9e1c4a175be7486c8c8ff5c.zip |
修正一个bug
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/vm/vm.lua | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua index c140589c..3db7900f 100644 --- a/server/src/vm/vm.lua +++ b/server/src/vm/vm.lua @@ -851,8 +851,14 @@ function mt:doFunction(action) if name[#name-1].type == ':' then local value = self:buildFunction(action) local source = name[#name] - local index = self:getIndex(source) - parent:setChild(index, value) + self:instantSource(source) + if source.type == 'index' then + local index = self:getIndex(source[1]) + parent:setChild(index, value) + elseif source.type == 'name' then + local index = source[1] + parent:setChild(index, value) + end source:bindValue(value, 'set') local func = value:getFunction() @@ -870,8 +876,14 @@ function mt:doFunction(action) else local value = self:buildFunction(action) local source = name[#name] - local index = self:getIndex(source) - parent:setChild(index, value) + self:instantSource(source) + if source.type == 'index' then + local index = self:getIndex(source[1]) + parent:setChild(index, value) + elseif source.type == 'name' then + local index = source[1] + parent:setChild(index, value) + end source:bindValue(value, 'set') end else |