diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-17 17:19:00 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-17 17:19:00 +0800 |
commit | be5ef0ab55f4cfa25c1a8a72c4f9df3c3adae16b (patch) | |
tree | abde9cd87cb262baa8da7ac0205ba3468b705e7f /script | |
parent | cf20156aa05c074d3f8ea2bf12277b4b06dfc8c4 (diff) | |
download | lua-language-server-be5ef0ab55f4cfa25c1a8a72c4f9df3c3adae16b.zip |
update
Diffstat (limited to 'script')
-rw-r--r-- | script/vm/node.lua | 2 | ||||
-rw-r--r-- | script/vm/type.lua | 11 |
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 |