summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/src')
-rw-r--r--server/src/method/textDocument/documentSymbol.lua4
-rw-r--r--server/src/service.lua6
2 files changed, 9 insertions, 1 deletions
diff --git a/server/src/method/textDocument/documentSymbol.lua b/server/src/method/textDocument/documentSymbol.lua
index 915c0126..664041e6 100644
--- a/server/src/method/textDocument/documentSymbol.lua
+++ b/server/src/method/textDocument/documentSymbol.lua
@@ -41,10 +41,11 @@ return function (lsp, params)
end
return function (response)
+ local clock = os.clock()
timerCache[uri] = ac.loop(0.1, function (t)
local vm, lines = lsp:getVM(uri)
if not vm then
- if not lsp:isWaitingCompile() then
+ if os.clock() - clock > 10 then
t:remove()
timerCache[uri] = nil
response(nil)
@@ -67,5 +68,6 @@ return function (lsp, params)
response(symbols)
end)
+ timerCache[uri]:onTimer()
end
end
diff --git a/server/src/service.lua b/server/src/service.lua
index 42178c99..74124ba6 100644
--- a/server/src/service.lua
+++ b/server/src/service.lua
@@ -280,6 +280,12 @@ function mt:reCompile()
obj:kill()
end
end
+ for _, obj in pairs(self._file) do
+ if obj.vm then
+ obj.vm:remove()
+ obj.vm = nil
+ end
+ end
self.global = core.global(self)
self.chain = chainMgr()