summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-21 16:23:51 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-21 16:23:51 +0800
commit8f4f9a7122168ba3944ec4fa791b94c8eff8750f (patch)
tree8212d56e4cb9de529ff59b1c65f57d07d305d3c3 /script/vm
parentc32bbad6aa97fafe98a76bb387ab0a687ebcd38e (diff)
downloadlua-language-server-8f4f9a7122168ba3944ec4fa791b94c8eff8750f.zip
update
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/type.lua15
1 files changed, 9 insertions, 6 deletions
diff --git a/script/vm/type.lua b/script/vm/type.lua
index 74e98ec2..e6541f1b 100644
--- a/script/vm/type.lua
+++ b/script/vm/type.lua
@@ -53,7 +53,8 @@ function vm.isSubType(uri, child, parent, mark)
end
elseif child.type == 'vm.node' then
for n in child:eachObject() do
- if getNodeName(n) and not vm.isSubType(uri, n, parent, mark) then
+ if getNodeName(n)
+ and not vm.isSubType(uri, n, parent, mark) then
return false
end
end
@@ -67,7 +68,8 @@ function vm.isSubType(uri, child, parent, mark)
end
elseif parent.type == 'vm.node' then
for n in parent:eachObject() do
- if getNodeName(n) and vm.isSubType(uri, child, n, mark) then
+ if getNodeName(n)
+ and vm.isSubType(uri, child, n, mark) then
return true
end
end
@@ -99,10 +101,11 @@ function vm.isSubType(uri, child, parent, mark)
end
-- check class parent
- if not mark[child] then
- mark[child] = true
- if child.type == 'global' and child.cate == 'type' then
- for _, set in ipairs(child:getSets(uri)) do
+ if childName and not mark[childName] then
+ mark[childName] = true
+ local childClass = vm.getGlobal('type', childName)
+ if childClass then
+ for _, set in ipairs(childClass:getSets(uri)) do
if set.type == 'doc.class' and set.extends then
for _, ext in ipairs(set.extends) do
if ext.type == 'doc.extends.name'