summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/src/async/async.lua2
-rw-r--r--server/src/service.lua4
-rw-r--r--server/src/workspace.lua1
3 files changed, 6 insertions, 1 deletions
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()