mirror of
https://github.com/openharmony/developtools_ace-ets2bundle.git
synced 2026-07-22 12:36:01 -04:00
@@ -58,7 +58,7 @@ function init(port) {
|
|||||||
}
|
}
|
||||||
rootFileNames.push(previewCacheFilePath);
|
rootFileNames.push(previewCacheFilePath);
|
||||||
ts.createWatchProgram(
|
ts.createWatchProgram(
|
||||||
createWatchCompilerHost(rootFileNames, resolveDiagnostic, delayPrintLogCount));
|
createWatchCompilerHost(rootFileNames, resolveDiagnostic, delayPrintLogCount, true));
|
||||||
const wss = new WebSocketServer({port: port});
|
const wss = new WebSocketServer({port: port});
|
||||||
wss.on('connection', function(ws) {
|
wss.on('connection', function(ws) {
|
||||||
pluginSocket = ws;
|
pluginSocket = ws;
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ function resolveModuleNames(moduleNames: string[], containingFile: string): ts.R
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function createWatchCompilerHost(rootFileNames: string[],
|
export function createWatchCompilerHost(rootFileNames: string[],
|
||||||
reportDiagnostic: ts.DiagnosticReporter, delayPrintLogCount: Function
|
reportDiagnostic: ts.DiagnosticReporter, delayPrintLogCount: Function, isPipe: boolean = false
|
||||||
): ts.WatchCompilerHostOfFilesAndCompilerOptions<ts.BuilderProgram> {
|
): ts.WatchCompilerHostOfFilesAndCompilerOptions<ts.BuilderProgram> {
|
||||||
setCompilerOptions();
|
setCompilerOptions();
|
||||||
const createProgram = ts.createSemanticDiagnosticsBuilderProgram;
|
const createProgram = ts.createSemanticDiagnosticsBuilderProgram;
|
||||||
@@ -196,7 +196,9 @@ export function createWatchCompilerHost(rootFileNames: string[],
|
|||||||
(diagnostic: ts.Diagnostic) => {
|
(diagnostic: ts.Diagnostic) => {
|
||||||
// End of compilation in watch mode flag.
|
// End of compilation in watch mode flag.
|
||||||
if ([6193, 6194].includes(diagnostic.code)) {
|
if ([6193, 6194].includes(diagnostic.code)) {
|
||||||
process.env.watchTs = 'end';
|
if (!isPipe) {
|
||||||
|
process.env.watchTs = 'end';
|
||||||
|
}
|
||||||
delayPrintLogCount();
|
delayPrintLogCount();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user