diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-06-24 12:15:23 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-06-24 12:15:23 +0800 |
commit | 221b378fa69132808a5d396b777866338cbe65a0 (patch) | |
tree | 4ead03112770e7f9beb30bab917f1b9e64582fdb | |
parent | 859bf22a7d50473ae796f9a33a15de413cf0604c (diff) | |
download | lua-language-server-221b378fa69132808a5d396b777866338cbe65a0.zip |
重载所有文件后跳过dead value的检测
-rw-r--r-- | server/src/service.lua | 7 | ||||
-rw-r--r-- | server/src/task.lua | 1 |
2 files changed, 4 insertions, 4 deletions
diff --git a/server/src/service.lua b/server/src/service.lua index 8ba9cd3b..5ed235c9 100644 --- a/server/src/service.lua +++ b/server/src/service.lua @@ -299,7 +299,6 @@ function mt:reCompile() self.emmy = emmyMgr() self.globalValue = nil self._compileTask:remove() - --self._compileTask = nil self._needCompile = {} local compiled = {} local n = 0 @@ -310,7 +309,7 @@ function mt:reCompile() end end log.debug('reCompile:', n) - self:_testMemory() + self:_testMemory('skip') end function mt:reDiagnostic() @@ -723,7 +722,7 @@ function mt:onUpdateConfig(updated, other) end end -function mt:_testMemory() +function mt:_testMemory(skipDead) local clock = os.clock() collectgarbage() log.debug('collectgarbage: ', ('%.3f'):format(os.clock() - clock)) @@ -841,7 +840,7 @@ function mt:_testMemory() )) log.debug('test memory: ', ('%.3f'):format(os.clock() - clock)) - if deadValue / totalValue >= 0.5 then + if deadValue / totalValue >= 0.5 and not skipDead then self:_testFindDeadValues() end end diff --git a/server/src/task.lua b/server/src/task.lua index 88db7a28..bb1a7922 100644 --- a/server/src/task.lua +++ b/server/src/task.lua @@ -7,6 +7,7 @@ function mt:remove() return end self._removed = true + coroutine.close(self.task) end function mt:isRemoved() |