summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-21 16:40:07 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-21 16:40:07 +0800
commit8af599790936f81cddaecb31d36eede70ad3739c (patch)
tree184f86524a29848869801ae01f2f21e3b4da1878 /script/vm
parent8f4f9a7122168ba3944ec4fa791b94c8eff8750f (diff)
downloadlua-language-server-8af599790936f81cddaecb31d36eede70ad3739c.zip
fix
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/compiler.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index fade0a78..99bd0691 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -1211,7 +1211,17 @@ local compilerSwitch = util.switch()
or source.parent.type == 'tableindex'
or source.parent.type == 'setfield'
or source.parent.type == 'setindex' then
- vm.setNode(source, vm.compileNode(source.parent))
+ local parentNode = vm.compileNode(source.parent)
+ for _, pn in ipairs(parentNode) do
+ if pn.type == 'global'
+ and pn.cate == 'type' then
+ if not guide.isBasicType(pn.name) then
+ vm.setNode(source, pn)
+ end
+ elseif pn.type == 'doc.type.table' then
+ vm.setNode(source, pn)
+ end
+ end
end
end)
: case 'function'