summaryrefslogtreecommitdiff
path: root/script/vm/compiler.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-01-09 17:15:22 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-01-09 17:15:22 +0800
commitc796d406329170e010590d7c9584b8483021cee3 (patch)
treea4f43228c38847acaf968aea1e46c8df3d88ec17 /script/vm/compiler.lua
parent78875f59fe2fa846d62bf955805b647d17cf87d2 (diff)
downloadlua-language-server-c796d406329170e010590d7c9584b8483021cee3.zip
support trace for global
Diffstat (limited to 'script/vm/compiler.lua')
-rw-r--r--script/vm/compiler.lua11
1 files changed, 4 insertions, 7 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index a36904f8..663d7446 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -1303,16 +1303,13 @@ local compilerSwitch = util.switch()
end)
: case 'setglobal'
: call(function (source)
+ if bindDocs(source) then
+ return
+ end
if source.node[1] ~= '_ENV' then
return
end
- local key = guide.getKeyName(source)
- vm.compileByParentNode(source.node, key, function (src)
- if src.type == 'doc.type.field'
- or src.type == 'doc.field' then
- vm.setNode(source, vm.compileNode(src))
- end
- end)
+ vm.setNode(source, vm.compileNode(source.value))
end)
: case 'getglobal'
: call(function (source)