diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-03-12 15:32:13 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-03-12 15:32:13 +0800 |
commit | 877540a64b8a2cbf51f8b67f9f31d397957f3654 (patch) | |
tree | d548cc06fa64fbb956ad9f3d180cf3338253e032 /server/src/vm | |
parent | 095984fc21264c4c13f785ef833d4711034dc28f (diff) | |
download | lua-language-server-877540a64b8a2cbf51f8b67f9f31d397957f3654.zip |
修改全局变量策略
Diffstat (limited to 'server/src/vm')
-rw-r--r-- | server/src/vm/vm.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua index a5c9168d..f78f2690 100644 --- a/server/src/vm/vm.lua +++ b/server/src/vm/vm.lua @@ -365,6 +365,11 @@ function mt:getName(name, source) source:bindValue(global, 'get') source:set('global', true) source:set('parent', ENVValue) + if not global:getLib() then + if self.lsp then + self.lsp.global:markGet(self:getUri()) + end + end return global end @@ -387,6 +392,9 @@ function mt:setName(name, source, value) ENVValue:setChild(name, value) source:set('global', true) source:set('parentValue', ENVValue) + if self.lsp then + self.lsp.global:markSet(self:getUri()) + end end function mt:getIndex(source) |