summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-27 21:00:38 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-28 14:00:50 +0800
commitd5327b0fc28e638ff79845846981358938deb9f2 (patch)
treea5cedb47bdeb8e77f2e43d4f61054821dca40176 /script
parentabdeade219bde1714fd8f145652d42315e1e6d25 (diff)
downloadlua-language-server-d5327b0fc28e638ff79845846981358938deb9f2.zip
improve
Diffstat (limited to 'script')
-rw-r--r--script/vm/compiler.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index d39c9c61..c249b44d 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -1893,11 +1893,14 @@ local function compileByGlobal(source)
globalNode:merge(vm.compileNode(set))
hasMarkDoc = true
end
+ if vm.getNode(set) then
+ globalNode:merge(vm.compileNode(set))
+ end
end
end
-- Set all globals node first to avoid recursive
for _, set in ipairs(global:getSets(uri)) do
- vm.setNode(set, globalNode)
+ vm.setNode(set, globalNode, true)
end
for _, set in ipairs(global:getSets(uri)) do
if set.value then
@@ -1905,7 +1908,9 @@ local function compileByGlobal(source)
globalNode:merge(vm.compileNode(set.value))
end
end
- vm.setNode(set, globalNode)
+ end
+ for _, set in ipairs(global:getSets(uri)) do
+ vm.setNode(set, globalNode, true)
end
end
if global.cate == 'type' then