summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-10 21:29:53 +0800
committersumneko <sumneko@hotmail.com>2019-04-10 21:29:53 +0800
commita97ca0012892604e12cf2e58c2d780140a498b81 (patch)
treea5fb42fb691e42b9f1993e2e7ca0eff8eb6fa6d5
parentccae29c7a288aa200fdab3b2ec4bd2688786d601 (diff)
downloadlua-language-server-a97ca0012892604e12cf2e58c2d780140a498b81.zip
减少chain的缓存空间
-rw-r--r--server/src/vm/chain.lua2
-rw-r--r--server/src/vm/vm.lua6
2 files changed, 4 insertions, 4 deletions
diff --git a/server/src/vm/chain.lua b/server/src/vm/chain.lua
index 55947105..7d56e1bf 100644
--- a/server/src/vm/chain.lua
+++ b/server/src/vm/chain.lua
@@ -26,7 +26,7 @@ function mt:clearCache()
end
end
self.count = n
- self.max = self.count * 2
+ self.max = self.count + 10
if self.max < self.min then
self.max = self.min
end
diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua
index 5b686bd5..4308ea2c 100644
--- a/server/src/vm/vm.lua
+++ b/server/src/vm/vm.lua
@@ -247,7 +247,7 @@ function mt:callLibrary(func, values, source, lib)
for i, arg in ipairs(lib.args) do
local value = values[i]
if value and arg.type ~= '...' then
- value:setType(arg.type, 0.9)
+ value:setType(arg.type, 0.6)
end
end
end
@@ -261,7 +261,7 @@ function mt:callLibrary(func, values, source, lib)
end
local value = func:getReturn(i)
if value then
- value:setType(rtn.type or 'any', 0.9)
+ value:setType(rtn.type or 'any', 0.6)
end
end
end
@@ -1224,7 +1224,7 @@ end
return function (ast, lsp, uri)
if not ast then
- return nil
+ return nil, 'Ast failed'
end
local vm = setmetatable({
funcs = {},