diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index f125fab5a5e..330aeaaa840 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -45,7 +45,7 @@ namespace ts { } /** @internal */ - const screenStartingMessageCodes: number[] = [ + export const screenStartingMessageCodes: number[] = [ Diagnostics.Starting_compilation_in_watch_mode.code, Diagnostics.File_change_detected_Starting_incremental_compilation.code, ]; diff --git a/src/harness/unittests/tscWatchMode.ts b/src/harness/unittests/tscWatchMode.ts index 99bad3e3091..d57a8e9b6d0 100644 --- a/src/harness/unittests/tscWatchMode.ts +++ b/src/harness/unittests/tscWatchMode.ts @@ -124,7 +124,10 @@ namespace ts.tscWatch { } function getWatchDiagnosticWithoutDate(diagnostic: Diagnostic) { - return ` - ${flattenDiagnosticMessageText(diagnostic.messageText, host.newLine)}${host.newLine + host.newLine + host.newLine}`; + const newLines = contains(screenStartingMessageCodes, diagnostic.code) + ? `${host.newLine}${host.newLine}` + : host.newLine; + return ` - ${flattenDiagnosticMessageText(diagnostic.messageText, host.newLine)}${newLines}`; } }