diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index c665744b1ea..235788258af 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2943,10 +2943,6 @@ "category": "Message", "code": 6040 }, - "Compilation complete. Watching for file changes.": { - "category": "Message", - "code": 6042 - }, "Generates corresponding '.map' file.": { "category": "Message", "code": 6043 @@ -3522,11 +3518,11 @@ "code": 6192, "reportsUnnecessary": true }, - "Found 1 error.": { + "Found 1 error. Watching for file changes.": { "category": "Message", "code": 6193 }, - "Found {0} errors.": { + "Found {0} errors. Watching for file changes.": { "category": "Message", "code": 6194 }, diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index 7f3d078b790..37aa0118801 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -29,9 +29,8 @@ namespace ts { /** @internal */ export const nonClearingMessageCodes: number[] = [ - Diagnostics.Compilation_complete_Watching_for_file_changes.code, - Diagnostics.Found_1_error.code, - Diagnostics.Found_0_errors.code + Diagnostics.Found_1_error_Watching_for_file_changes.code, + Diagnostics.Found_0_errors_Watching_for_file_changes.code ]; function clearScreenIfNotWatchingForFileChanges(system: System, diagnostic: Diagnostic, options: CompilerOptions) { @@ -231,10 +230,10 @@ namespace ts { const reportSummary = (errorCount: number) => { if (errorCount === 1) { - onWatchStatusChange(createCompilerDiagnostic(Diagnostics.Found_1_error, errorCount), newLine, compilerOptions); + onWatchStatusChange(createCompilerDiagnostic(Diagnostics.Found_1_error_Watching_for_file_changes, errorCount), newLine, compilerOptions); } else { - onWatchStatusChange(createCompilerDiagnostic(Diagnostics.Found_0_errors, errorCount, errorCount), newLine, compilerOptions); + onWatchStatusChange(createCompilerDiagnostic(Diagnostics.Found_0_errors_Watching_for_file_changes, errorCount, errorCount), newLine, compilerOptions); } }; @@ -644,7 +643,7 @@ namespace ts { if (host.afterProgramCreate) { host.afterProgramCreate(builderProgram); } - reportWatchDiagnostic(Diagnostics.Compilation_complete_Watching_for_file_changes); + return builderProgram; } diff --git a/src/harness/unittests/tscWatchMode.ts b/src/harness/unittests/tscWatchMode.ts index 99bad3e3091..c8faba855dc 100644 --- a/src/harness/unittests/tscWatchMode.ts +++ b/src/harness/unittests/tscWatchMode.ts @@ -130,8 +130,8 @@ namespace ts.tscWatch { function createErrorsFoundCompilerDiagnostic(errors: ReadonlyArray) { return errors.length === 1 - ? createCompilerDiagnostic(Diagnostics.Found_1_error) - : createCompilerDiagnostic(Diagnostics.Found_0_errors, errors.length); + ? createCompilerDiagnostic(Diagnostics.Found_1_error_Watching_for_file_changes) + : createCompilerDiagnostic(Diagnostics.Found_0_errors_Watching_for_file_changes, errors.length); } function checkOutputErrorsInitial(host: WatchedSystem, errors: ReadonlyArray, disableConsoleClears?: boolean, logsBeforeErrors?: string[]) { @@ -142,8 +142,7 @@ namespace ts.tscWatch { logsBeforeErrors, errors, disableConsoleClears, - createErrorsFoundCompilerDiagnostic(errors), - createCompilerDiagnostic(Diagnostics.Compilation_complete_Watching_for_file_changes)); + createErrorsFoundCompilerDiagnostic(errors)); } function checkOutputErrorsIncremental(host: WatchedSystem, errors: ReadonlyArray, disableConsoleClears?: boolean, logsBeforeWatchDiagnostic?: string[], logsBeforeErrors?: string[]) { @@ -154,8 +153,7 @@ namespace ts.tscWatch { logsBeforeErrors, errors, disableConsoleClears, - createErrorsFoundCompilerDiagnostic(errors), - createCompilerDiagnostic(Diagnostics.Compilation_complete_Watching_for_file_changes)); + createErrorsFoundCompilerDiagnostic(errors)); } function checkOutputErrorsIncrementalWithExit(host: WatchedSystem, errors: ReadonlyArray, expectedExitCode: ExitStatus, disableConsoleClears?: boolean, logsBeforeWatchDiagnostic?: string[], logsBeforeErrors?: string[]) {