summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-17 17:19:00 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-17 17:19:00 +0800
commitbe5ef0ab55f4cfa25c1a8a72c4f9df3c3adae16b (patch)
treeabde9cd87cb262baa8da7ac0205ba3468b705e7f /script
parentcf20156aa05c074d3f8ea2bf12277b4b06dfc8c4 (diff)
downloadlua-language-server-be5ef0ab55f4cfa25c1a8a72c4f9df3c3adae16b.zip
update
Diffstat (limited to 'script')
-rw-r--r--script/vm/node.lua2
-rw-r--r--script/vm/type.lua11
2 files changed, 10 insertions, 3 deletions
diff --git a/script/vm/node.lua b/script/vm/node.lua
index 1b3ea45c..39ed219e 100644
--- a/script/vm/node.lua
+++ b/script/vm/node.lua
@@ -214,6 +214,8 @@ function mt:remove(name)
or (c.type == name)
or (c.type == 'doc.type.integer' and (name == 'number' or name == 'integer'))
or (c.type == 'doc.type.boolean' and name == 'boolean')
+ or (c.type == 'doc.type.boolean' and name == 'true' and c[1] == true)
+ or (c.type == 'doc.type.boolean' and name == 'false' and c[1] == false)
or (c.type == 'doc.type.table' and name == 'table')
or (c.type == 'doc.type.array' and name == 'table')
or (c.type == 'doc.type.function' and name == 'function') then
diff --git a/script/vm/type.lua b/script/vm/type.lua
index 50c9efa7..3ad60dae 100644
--- a/script/vm/type.lua
+++ b/script/vm/type.lua
@@ -60,11 +60,11 @@ function vm.isSubType(uri, child, parent, mark)
end
elseif parent.type == 'vm.node' then
for n in parent:eachObject() do
- if getNodeName(n) and not vm.isSubType(uri, child, n, mark) then
- return false
+ if getNodeName(n) and vm.isSubType(uri, child, n, mark) then
+ return true
end
end
- return true
+ return false
end
local childName = getNodeName(child)
@@ -78,6 +78,11 @@ function vm.isSubType(uri, child, parent, mark)
return true
end
+ if (childName == 'true' or childName == 'false')
+ and parentName == 'boolean' then
+ return true
+ end
+
-- check class parent
if not mark[child] then
mark[child] = true