Skip to content

Commit d1b044b

Browse files
author
Josh Goldberg
committed
Standardized for --preserveWatchOutput too
1 parent c974b2c commit d1b044b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/compiler/watch.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ namespace ts {
5050
Diagnostics.File_change_detected_Starting_incremental_compilation.code,
5151
];
5252

53-
function getPlainDiagnosticPrecedingNewLines(diagnostic: Diagnostic, newLine: string): string {
54-
return contains(screenStartingMessageCodes, diagnostic.code)
53+
function getPlainDiagnosticPrecedingNewLines(diagnostic: Diagnostic, newLine: string, preserveWatchOutput?: boolean): string {
54+
return !preserveWatchOutput && contains(screenStartingMessageCodes, diagnostic.code)
5555
? ""
5656
: newLine;
5757
}
@@ -75,7 +75,7 @@ namespace ts {
7575
} :
7676
(diagnostic, newLine, options) => {
7777
clearScreenIfNotWatchingForFileChanges(system, diagnostic, options);
78-
let output = `${getPlainDiagnosticPrecedingNewLines(diagnostic, newLine)}${new Date().toLocaleTimeString()} - `;
78+
let output = `${getPlainDiagnosticPrecedingNewLines(diagnostic, newLine, options.preserveWatchOutput)}${new Date().toLocaleTimeString()} - `;
7979
output += `${flattenDiagnosticMessageText(diagnostic.messageText, system.newLine)}${getPlainDiagnosticFollowingNewLines(diagnostic, newLine)}`;
8080
system.write(output);
8181
};

0 commit comments

Comments
 (0)