summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-27 20:33:31 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-27 20:33:31 +0800
commitd60ff4632d81d4357118f724b61ff5d0c6943ac5 (patch)
treef28899d94d17e5f0ea914422e827a720888e4633 /script/vm
parentd00caddd44ccd4cad150328776fe0166f06c14d2 (diff)
downloadlua-language-server-d60ff4632d81d4357118f724b61ff5d0c6943ac5.zip
#1240 fix performance issue of globals
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/compiler.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index ad3295f7..9968c4b9 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -1886,6 +1886,10 @@ local function compileByGlobal(source)
end
end
end
+ -- Set all globals node first to avoid recursive
+ for _, set in ipairs(global:getSets(uri)) do
+ vm.setNode(set, globalNode)
+ end
for _, set in ipairs(global:getSets(uri)) do
if set.value then
if not hasMarkDoc or guide.isLiteral(set.value) then