diff options
author | sumneko <sumneko@hotmail.com> | 2019-05-05 14:11:18 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-05-05 14:11:18 +0800 |
commit | 1a3ff586501cc6f8bd29f53664b399c1c976f269 (patch) | |
tree | abd6037f6f590f82257808e18e5dec4a1086dd55 /server | |
parent | c85e32e8e124ab70b1286349469fb838e06b06c9 (diff) | |
download | lua-language-server-1a3ff586501cc6f8bd29f53664b399c1c976f269.zip |
修正初始打开的文件没有符号的问你
Diffstat (limited to 'server')
-rw-r--r-- | server/src/method/textDocument/documentSymbol.lua | 4 | ||||
-rw-r--r-- | server/src/service.lua | 6 |
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() |