Skip to content

Commit 82aa1fb

Browse files
committed
Get new line before writing log to log correct output
1 parent 22c0444 commit 82aa1fb

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/compiler/watch.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,14 +488,14 @@ namespace ts {
488488
const watchFilePath = compilerOptions.extendedDiagnostics ? ts.addFilePathWatcherWithLogging : ts.addFilePathWatcher;
489489
const watchDirectoryWorker = compilerOptions.extendedDiagnostics ? ts.addDirectoryWatcherWithLogging : ts.addDirectoryWatcher;
490490

491+
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames);
492+
let newLine = updateNewLine();
493+
491494
writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${useCaseSensitiveFileNames}`);
492495
if (configFileName) {
493496
watchFile(host, configFileName, scheduleProgramReload, writeLog);
494497
}
495498

496-
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames);
497-
let newLine = updateNewLine();
498-
499499
const compilerHost: CompilerHost & ResolutionCacheHost = {
500500
// Members for CompilerHost
501501
getSourceFile: (fileName, languageVersion, onError?, shouldCreateNewSourceFile?) => getVersionedSourceFileByPath(fileName, toPath(fileName), languageVersion, onError, shouldCreateNewSourceFile),
@@ -583,7 +583,9 @@ namespace ts {
583583

584584
// Compile the program
585585
if (loggingEnabled) {
586-
writeLog(`CreatingProgramWith::\n roots: ${JSON.stringify(rootFileNames)}\n options: ${JSON.stringify(compilerOptions)}`);
586+
writeLog(`CreatingProgramWith::`);
587+
writeLog(` roots: ${JSON.stringify(rootFileNames)}`);
588+
writeLog(` options: ${JSON.stringify(compilerOptions)}`);
587589
}
588590

589591
const needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !program;

0 commit comments

Comments
 (0)