summaryrefslogtreecommitdiff
path: root/server/src/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-12 15:32:13 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-12 15:32:13 +0800
commit877540a64b8a2cbf51f8b67f9f31d397957f3654 (patch)
treed548cc06fa64fbb956ad9f3d180cf3338253e032 /server/src/vm
parent095984fc21264c4c13f785ef833d4711034dc28f (diff)
downloadlua-language-server-877540a64b8a2cbf51f8b67f9f31d397957f3654.zip
修改全局变量策略
Diffstat (limited to 'server/src/vm')
-rw-r--r--server/src/vm/vm.lua8
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)