From c7a0b295570e78a43f0819d9e0ba9a4c076b7e1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 13 Jan 2021 15:33:57 +0800 Subject: pause diagnostic before preload --- script/provider/diagnostic.lua | 5 +++++ script/workspace/workspace.lua | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua index 1d8b779d..acea679a 100644 --- a/script/provider/diagnostic.lua +++ b/script/provider/diagnostic.lua @@ -268,6 +268,11 @@ function m.start() m.diagnosticsAll() end +function m.pause() + m._start = false + await.close 'diagnosticsAll' +end + function m.checkStepResult() if await.hasID 'diagnosticsAll' then return diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index 0f2b3f09..ca490886 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -255,8 +255,10 @@ end --- 预读工作区内所有文件 function m.awaitPreload() + local diagnostic = require 'provider.diagnostic' await.close 'preload' await.setID 'preload' + diagnostic.pause() m.libraryMatchers = nil m.nativeMatcher = nil m.cache = {} @@ -292,7 +294,6 @@ function m.awaitPreload() log.info('Preload finish.') - local diagnostic = require 'provider.diagnostic' diagnostic.start() end -- cgit v1.2.3