@@ -53,6 +53,7 @@ namespace ts {
5353 /*@internal */ clean ?: boolean ;
5454 /*@internal */ watch ?: boolean ;
5555 /*@internal */ help ?: boolean ;
56+ preserveWatchOutput ?: boolean ;
5657 }
5758
5859 enum BuildResultFlags {
@@ -464,6 +465,12 @@ namespace ts {
464465 host . reportSolutionBuilderStatus ( createCompilerDiagnostic ( message , ...args ) ) ;
465466 }
466467
468+ function reportWatchStatus ( message : DiagnosticMessage , ...args : string [ ] ) {
469+ if ( hostWithWatch . onWatchStatusChange ) {
470+ hostWithWatch . onWatchStatusChange ( createCompilerDiagnostic ( message , ...args ) , host . getNewLine ( ) , { preserveWatchOutput : context . options . preserveWatchOutput } ) ;
471+ }
472+ }
473+
467474 function startWatching ( ) {
468475 const graph = getGlobalDependencyGraph ( ) ! ;
469476 if ( ! graph . buildQueue ) {
@@ -499,6 +506,7 @@ namespace ts {
499506 }
500507
501508 function invalidateProjectAndScheduleBuilds ( resolved : ResolvedConfigFileName ) {
509+ reportWatchStatus ( Diagnostics . File_change_detected_Starting_incremental_compilation ) ;
502510 invalidateProject ( resolved ) ;
503511 if ( ! hostWithWatch . setTimeout ) {
504512 return ;
@@ -1037,6 +1045,7 @@ namespace ts {
10371045 }
10381046
10391047 function buildAllProjects ( ) : ExitStatus {
1048+ if ( context . options . watch ) { reportWatchStatus ( Diagnostics . Starting_compilation_in_watch_mode ) ; }
10401049 const graph = getGlobalDependencyGraph ( ) ;
10411050 if ( graph === undefined ) return ExitStatus . DiagnosticsPresent_OutputsSkipped ;
10421051
0 commit comments