From d1b044b72fecb7303336f17efafaba8b70416959 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Wed, 18 Apr 2018 17:08:43 -0700 Subject: [PATCH] Standardized for --preserveWatchOutput too --- src/compiler/watch.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index 330aeaaa840..3140d975a3d 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -50,8 +50,8 @@ namespace ts { Diagnostics.File_change_detected_Starting_incremental_compilation.code, ]; - function getPlainDiagnosticPrecedingNewLines(diagnostic: Diagnostic, newLine: string): string { - return contains(screenStartingMessageCodes, diagnostic.code) + function getPlainDiagnosticPrecedingNewLines(diagnostic: Diagnostic, newLine: string, preserveWatchOutput?: boolean): string { + return !preserveWatchOutput && contains(screenStartingMessageCodes, diagnostic.code) ? "" : newLine; } @@ -75,7 +75,7 @@ namespace ts { } : (diagnostic, newLine, options) => { clearScreenIfNotWatchingForFileChanges(system, diagnostic, options); - let output = `${getPlainDiagnosticPrecedingNewLines(diagnostic, newLine)}${new Date().toLocaleTimeString()} - `; + let output = `${getPlainDiagnosticPrecedingNewLines(diagnostic, newLine, options.preserveWatchOutput)}${new Date().toLocaleTimeString()} - `; output += `${flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)}${getPlainDiagnosticFollowingNewLines(diagnostic, newLine)}`; system.write(output); };