diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-02-26 17:03:58 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-02-26 17:03:58 +0800 |
commit | 18694a6c3453206c453c41c0da0bcf4e4d62c8f7 (patch) | |
tree | b458507851eb781c4fd4ad484a12f9fb9ec8a657 | |
parent | a7d4e8df1ec6a560a5bbf3a3917b6e89c8cc9c92 (diff) | |
download | lua-language-server-18694a6c3453206c453c41c0da0bcf4e4d62c8f7.zip |
函数设置到最后一个source上
-rw-r--r-- | server/src/vm/vm.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua index 32bc3bc2..d8905538 100644 --- a/server/src/vm/vm.lua +++ b/server/src/vm/vm.lua @@ -854,8 +854,10 @@ function mt:doFunction(action) local parent = self:getSimple(name, -2) if name[#name-1].type == ':' then local value = self:buildFunction(action) - local index = self:getIndex(name[#name]) + local source = name[#name] + local index = self:getIndex(source) parent:setChild(index, value) + source:bindValue(value, 'set') local func = value:getFunction() if #name == 3 then @@ -871,12 +873,15 @@ function mt:doFunction(action) end else local value = self:buildFunction(action) - local index = self:getIndex(name[#name]) + local source = name[#name] + local index = self:getIndex(source) parent:setChild(index, value) + source:bindValue(value, 'set') end else local value = self:buildFunction(action) - self:setName(name[1], action, value) + self:setName(name[1], name, value) + name:bindValue(value, 'set') end else self:buildFunction(action) |