summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-01-21 16:05:22 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-01-21 16:05:22 +0800
commit2166bae734d509795a6568aece5afeba8c4262eb (patch)
tree2dd24fb5bf1feb5f8c4f249dcc6b65e6adb0b546
parente9c7d91660f032190eb6d2365f2bad8cf9500ba9 (diff)
downloadlua-language-server-2166bae734d509795a6568aece5afeba8c4262eb.zip
编译脚本时检查新的协议
-rw-r--r--server/src/core/vm.lua3
-rw-r--r--server/src/service.lua7
2 files changed, 7 insertions, 3 deletions
diff --git a/server/src/core/vm.lua b/server/src/core/vm.lua
index 4adc5044..99e92fe5 100644
--- a/server/src/core/vm.lua
+++ b/server/src/core/vm.lua
@@ -1436,6 +1436,9 @@ end
function mt:doActions(actions)
for _, action in ipairs(actions) do
self:doAction(action)
+ if coroutine.isyieldable() then
+ coroutine.yield()
+ end
end
end
diff --git a/server/src/service.lua b/server/src/service.lua
index dc680ec0..0986aa9f 100644
--- a/server/src/service.lua
+++ b/server/src/service.lua
@@ -385,11 +385,12 @@ function mt:_doCompileTask()
if not suc then
break
end
- if coroutine.status(self._compileTask) == 'dead' then
+ if coroutine.status(self._compileTask) == 'suspended' then
+ self:_loadProto()
+ else
self._compileTask = nil
- break
+ return
end
- self:_loadProto()
end
end