summaryrefslogtreecommitdiff
path: root/script/vm/infer.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-07 15:38:18 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-07 15:38:18 +0800
commitf5464ddc9a8e043977f27e70d9f1dfc2be56b02e (patch)
treeb2c3d0e061753e69105997a81c6e8567998054cf /script/vm/infer.lua
parent0b87804cba3f24318362993ca2e32e0f95ce990d (diff)
downloadlua-language-server-f5464ddc9a8e043977f27e70d9f1dfc2be56b02e.zip
`boolean` kick `true` and `false`
Diffstat (limited to 'script/vm/infer.lua')
-rw-r--r--script/vm/infer.lua15
1 files changed, 7 insertions, 8 deletions
diff --git a/script/vm/infer.lua b/script/vm/infer.lua
index b1b7183e..94538a79 100644
--- a/script/vm/infer.lua
+++ b/script/vm/infer.lua
@@ -11,7 +11,6 @@ local vm = require 'vm.vm'
---@field _drop table
local mt = {}
mt.__index = mt
-mt._hasNumber = false
mt._hasTable = false
mt._hasClass = false
mt._hasFunctionDef = false
@@ -45,7 +44,6 @@ local viewNodeSwitch = util.switch()
end)
: case 'number'
: call(function (source, infer)
- infer._hasNumber = true
return source.type
end)
: case 'table'
@@ -81,9 +79,6 @@ local viewNodeSwitch = util.switch()
if not guide.isBasicType(source.name) then
infer._hasClass = true
end
- if source.name == 'number' then
- infer._hasNumber = true
- end
return source.name
end
end)
@@ -252,9 +247,6 @@ function vm.getInfer(source)
end
function mt:_trim()
- if self._hasNumber then
- self.views['integer'] = nil
- end
if self._hasDocFunction then
if self._hasFunctionDef then
for view in pairs(self.views) do
@@ -269,6 +261,13 @@ function mt:_trim()
if self._hasTable and not self._hasClass then
self.views['table'] = true
end
+ if self.views['number'] then
+ self.views['integer'] = nil
+ end
+ if self.views['boolean'] then
+ self.views['true'] = nil
+ self.views['false'] = nil
+ end
end
---@param uri uri