summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-01 16:07:17 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-01 16:07:17 +0800
commitcaed96510b21d6bdd9e1c4a175be7486c8c8ff5c (patch)
treee74dc1d03c9d90d360db75feb0015db19e9a34fe /server
parent302526e4311cb7f54b327d7bdd999a2e60f89eba (diff)
downloadlua-language-server-caed96510b21d6bdd9e1c4a175be7486c8c8ff5c.zip
修正一个bug
Diffstat (limited to 'server')
-rw-r--r--server/src/vm/vm.lua20
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