From 82aa1fbbe4e38896f4d4f430b3326544537dbf90 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 7 Feb 2018 09:21:38 -0800 Subject: [PATCH] Get new line before writing log to log correct output --- src/compiler/watch.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index 2f03e5bc5d4..7a98c43dd04 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -488,14 +488,14 @@ namespace ts { const watchFilePath = compilerOptions.extendedDiagnostics ? ts.addFilePathWatcherWithLogging : ts.addFilePathWatcher; const watchDirectoryWorker = compilerOptions.extendedDiagnostics ? ts.addDirectoryWatcherWithLogging : ts.addDirectoryWatcher; + const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); + let newLine = updateNewLine(); + writeLog(`Current directory: ${currentDirectory} CaseSensitiveFileNames: ${useCaseSensitiveFileNames}`); if (configFileName) { watchFile(host, configFileName, scheduleProgramReload, writeLog); } - const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); - let newLine = updateNewLine(); - const compilerHost: CompilerHost & ResolutionCacheHost = { // Members for CompilerHost getSourceFile: (fileName, languageVersion, onError?, shouldCreateNewSourceFile?) => getVersionedSourceFileByPath(fileName, toPath(fileName), languageVersion, onError, shouldCreateNewSourceFile), @@ -583,7 +583,9 @@ namespace ts { // Compile the program if (loggingEnabled) { - writeLog(`CreatingProgramWith::\n roots: ${JSON.stringify(rootFileNames)}\n options: ${JSON.stringify(compilerOptions)}`); + writeLog(`CreatingProgramWith::`); + writeLog(` roots: ${JSON.stringify(rootFileNames)}`); + writeLog(` options: ${JSON.stringify(compilerOptions)}`); } const needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !program;