From cce865e45c3d3c50690c5274d913fc75d4f7c4eb Mon Sep 17 00:00:00 2001 From: lizhouze Date: Thu, 4 Aug 2022 15:44:04 +0800 Subject: [PATCH] lizhouze@huawei.com Signed-off-by: lizhouze --- compiler/server/build_pipe_server.js | 2 +- compiler/src/ets_checker.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/compiler/server/build_pipe_server.js b/compiler/server/build_pipe_server.js index 16d8fc5..33dad9a 100644 --- a/compiler/server/build_pipe_server.js +++ b/compiler/server/build_pipe_server.js @@ -58,7 +58,7 @@ function init(port) { } rootFileNames.push(previewCacheFilePath); ts.createWatchProgram( - createWatchCompilerHost(rootFileNames, resolveDiagnostic, delayPrintLogCount)); + createWatchCompilerHost(rootFileNames, resolveDiagnostic, delayPrintLogCount, true)); const wss = new WebSocketServer({port: port}); wss.on('connection', function(ws) { pluginSocket = ws; diff --git a/compiler/src/ets_checker.ts b/compiler/src/ets_checker.ts index 8d83973..587da55 100644 --- a/compiler/src/ets_checker.ts +++ b/compiler/src/ets_checker.ts @@ -186,7 +186,7 @@ function resolveModuleNames(moduleNames: string[], containingFile: string): ts.R } export function createWatchCompilerHost(rootFileNames: string[], - reportDiagnostic: ts.DiagnosticReporter, delayPrintLogCount: Function + reportDiagnostic: ts.DiagnosticReporter, delayPrintLogCount: Function, isPipe: boolean = false ): ts.WatchCompilerHostOfFilesAndCompilerOptions { setCompilerOptions(); const createProgram = ts.createSemanticDiagnosticsBuilderProgram; @@ -196,7 +196,9 @@ export function createWatchCompilerHost(rootFileNames: string[], (diagnostic: ts.Diagnostic) => { // End of compilation in watch mode flag. if ([6193, 6194].includes(diagnostic.code)) { - process.env.watchTs = 'end'; + if (!isPipe) { + process.env.watchTs = 'end'; + } delayPrintLogCount(); } });