From 5df9959be4a51ab567743b72753f15a24b8f7ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 22 Jan 2019 16:34:59 +0800 Subject: =?UTF-8?q?=E6=8A=8A=E6=89=80=E6=9C=89=E6=96=87=E4=BB=B6=E9=83=BD?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E8=BF=9B=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/async/async.lua | 2 +- server/src/service.lua | 4 ++++ server/src/workspace.lua | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'server/src') diff --git a/server/src/async/async.lua b/server/src/async/async.lua index b381ae11..953cf5cf 100644 --- a/server/src/async/async.lua +++ b/server/src/async/async.lua @@ -78,7 +78,7 @@ local function callback(id, running) end -- TODO 封装成对象 local suc, destroy = xpcall(running.callback, log.error, result) - if suc and destroy then + if not suc or destroy then RunningList[id] = nil IdlePool[#IdlePool+1] = running.task break diff --git a/server/src/service.lua b/server/src/service.lua index cd1572e9..37cb048e 100644 --- a/server/src/service.lua +++ b/server/src/service.lua @@ -156,6 +156,7 @@ function mt:readText(uri, path) end local text = io.load(path) if not text then + log.debug('无法找到文件:', path) return end self._file[uri] = { @@ -175,9 +176,12 @@ end function mt:reCompile() local compiled = {} + local n = 0 for uri in pairs(self._file) do self:needCompile(uri, compiled) + n = n + 1 end + log.debug('reCompile:', n) if self._needShowComplete then self._needShowComplete = nil diff --git a/server/src/workspace.lua b/server/src/workspace.lua index 2b74ad6d..283b4951 100644 --- a/server/src/workspace.lua +++ b/server/src/workspace.lua @@ -99,6 +99,7 @@ function mt:init(rootUri) if ok then local uri = self:uriEncode(path) self.files[name] = uri + self.lsp:readText(uri, path) end end self:reset() -- cgit v1.2.3