diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-11-20 15:38:50 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-11-20 15:38:50 +0800 |
commit | a65a1ddb13854c2dfde4c04630a0a942abdafa32 (patch) | |
tree | 67d0121bf35f8c487119972b076fd8a6d41c04e6 | |
parent | 50523d92c56de6eead73629b60916d9b9b892204 (diff) | |
download | lua-language-server-a65a1ddb13854c2dfde4c04630a0a942abdafa32.zip |
在空闲时执行垃圾回收
-rw-r--r-- | main.lua | 3 | ||||
-rw-r--r-- | src/lsp.lua | 2 |
2 files changed, 5 insertions, 0 deletions
@@ -13,6 +13,9 @@ dbg:start() require 'utility' require 'global_protect' + +collectgarbage 'stop' + local service = require 'service' local session = service() diff --git a/src/lsp.lua b/src/lsp.lua index cc35cf39..4a88aba6 100644 --- a/src/lsp.lua +++ b/src/lsp.lua @@ -79,6 +79,8 @@ function mt:_readAsContent(header) if not response then log.error(err or ('没有回应:' .. method)) end + -- 运行时不清理垃圾,在回复前端之后清理垃圾 + collectgarbage() end function mt:setInput(input) |