diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-01-09 17:15:22 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-01-09 17:15:22 +0800 |
commit | c796d406329170e010590d7c9584b8483021cee3 (patch) | |
tree | a4f43228c38847acaf968aea1e46c8df3d88ec17 /script/vm/global.lua | |
parent | 78875f59fe2fa846d62bf955805b647d17cf87d2 (diff) | |
download | lua-language-server-c796d406329170e010590d7c9584b8483021cee3.zip |
support trace for global
Diffstat (limited to 'script/vm/global.lua')
-rw-r--r-- | script/vm/global.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/script/vm/global.lua b/script/vm/global.lua index 5f32cd87..f9090893 100644 --- a/script/vm/global.lua +++ b/script/vm/global.lua @@ -521,10 +521,15 @@ function vm.compileByGlobal(source) if global.cate == 'variable' then vm.setNode(source, global) if guide.isAssign(source) then - vm.setNode(source, vm.compileNode(source.value)) + if source.value then + vm.setNode(source, vm.compileNode(source.value)) + end return end - vm.traceNode(source) + local node = vm.traceNode(source) + if node then + vm.setNode(source, node, true) + end return end local globalBase = vm.getGlobalBase(source) |