summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-05-23 19:57:32 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-05-23 19:57:32 +0800
commitfd4336161730b79c1d8fecf42a681037f89f6c01 (patch)
treedd8520e29978dc562ccccbd21030340ec6996ab4 /script/vm
parent4a284d1f4ea958e0973337c4bb1349102734f4fd (diff)
downloadlua-language-server-fd4336161730b79c1d8fecf42a681037f89f6c01.zip
fix infer of global sets
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/compiler.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index 75620d19..6c95b5bd 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -530,6 +530,7 @@ local function bindAs(source)
return false
end
+-- 该函数有副作用,会给source绑定node!
local function bindDocs(source)
local isParam = source.parent.type == 'funcargs'
or source.parent.type == 'in'
@@ -565,12 +566,12 @@ local function bindDocs(source)
local name = doc.module
local uri = rpath.findUrisByRequirePath(guide.getUri(source), name)[1]
if not uri then
- return nil
+ return true
end
local state = files.getState(uri)
local ast = state and state.ast
if not ast then
- return nil
+ return true
end
vm.setNode(source, vm.compileNode(ast))
return true
@@ -1815,6 +1816,7 @@ local function compileByGlobal(source)
end
end
end
+ vm.setNode(set, globalNode)
end
end
if global.cate == 'type' then