diff options
author | sumneko <sumneko@hotmail.com> | 2019-04-19 17:55:08 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-04-19 17:55:08 +0800 |
commit | ffeb9df51d7f440c004d41522990c6ebbadcc569 (patch) | |
tree | 1698ab520e6dfd3be74e60ce335973c31335076f /server/src/vm | |
parent | 02631f902a8230e173bd46dd83193c69e06bb7f1 (diff) | |
download | lua-language-server-ffeb9df51d7f440c004d41522990c6ebbadcc569.zip |
暂存一下:type共用通过merge value实现,还要标记global
Diffstat (limited to 'server/src/vm')
-rw-r--r-- | server/src/vm/local.lua | 1 | ||||
-rw-r--r-- | server/src/vm/value.lua | 9 |
2 files changed, 8 insertions, 2 deletions
diff --git a/server/src/vm/local.lua b/server/src/vm/local.lua index d047b106..618214ff 100644 --- a/server/src/vm/local.lua +++ b/server/src/vm/local.lua @@ -143,7 +143,6 @@ function mt:setEmmy(emmy) if emmy.type ~= 'emmy.class' and emmy.type ~= 'emmy.type' then return end - self._emmy = emmy if self.value then self.value:setEmmy(emmy) end diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua index b3cc5f80..19aa1ee4 100644 --- a/server/src/vm/value.lua +++ b/server/src/vm/value.lua @@ -522,7 +522,14 @@ function mt:setEmmy(emmy) if not emmy then return end - if emmy.type ~= 'emmy.class' and emmy.type ~= 'emmy.type' then + if emmy.type == 'emmy.class' then + emmy:setValue(self) + elseif emmy.type == 'emmy.type' then + local class = emmy:getClass() + if class then + self:mergeValue(class:getValue()) + end + else return end self._emmy = emmy |