diff options
author | sumneko <sumneko@hotmail.com> | 2019-04-22 16:23:46 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-04-22 16:23:46 +0800 |
commit | 2523bad318880bf7547f5d095fce4a681fe24a54 (patch) | |
tree | c455011faec35182915adb2ab7b2a02b7dfb8461 /server/src/vm/value.lua | |
parent | efa8bfce8228bc615e2870cbc4394bef0ab3cb9d (diff) | |
download | lua-language-server-2523bad318880bf7547f5d095fce4a681fe24a54.zip |
更新emmy
Diffstat (limited to 'server/src/vm/value.lua')
-rw-r--r-- | server/src/vm/value.lua | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua index 20e6f5d7..63e15cc8 100644 --- a/server/src/vm/value.lua +++ b/server/src/vm/value.lua @@ -322,7 +322,7 @@ function mt:mergeValue(value) if not value then return end - local global = self._global + local global = self._global or value._global local list = {self, value} local pos = 1 while true do @@ -351,13 +351,14 @@ function mt:mergeValue(value) list[#list+1] = bc end end - if global then - bc:markGlobal() - end a._child[k] = bc end end b._child = a._child + if global then + a:markGlobal() + b:markGlobal() + end if b._meta then a._meta = b._meta @@ -530,7 +531,14 @@ function mt:setEmmy(emmy) end if emmy.type == 'emmy.class' then emmy:setValue(self) + emmy:eachChild(function (obj) + local value = obj:getValue() + if value then + value:mergeValue(self) + end + end) elseif emmy.type == 'emmy.type' then + emmy:setValue(self) local class = emmy:getClass() if class then self:mergeValue(class:getValue()) |