@@ -54,6 +54,7 @@ namespace ts {
54
54
/*@internal */ clean ?: boolean ;
55
55
/*@internal */ watch ?: boolean ;
56
56
/*@internal */ help ?: boolean ;
57
+ preserveWatchOutput ?: boolean ;
57
58
}
58
59
59
60
enum BuildResultFlags {
@@ -465,6 +466,12 @@ namespace ts {
465
466
host . reportSolutionBuilderStatus ( createCompilerDiagnostic ( message , ...args ) ) ;
466
467
}
467
468
469
+ function reportWatchStatus ( message : DiagnosticMessage , ...args : string [ ] ) {
470
+ if ( hostWithWatch . onWatchStatusChange ) {
471
+ hostWithWatch . onWatchStatusChange ( createCompilerDiagnostic ( message , ...args ) , host . getNewLine ( ) , { preserveWatchOutput : context . options . preserveWatchOutput } ) ;
472
+ }
473
+ }
474
+
468
475
function startWatching ( ) {
469
476
const graph = getGlobalDependencyGraph ( ) ! ;
470
477
if ( ! graph . buildQueue ) {
@@ -500,6 +507,7 @@ namespace ts {
500
507
}
501
508
502
509
function invalidateProjectAndScheduleBuilds ( resolved : ResolvedConfigFileName ) {
510
+ reportWatchStatus ( Diagnostics . File_change_detected_Starting_incremental_compilation ) ;
503
511
invalidateProject ( resolved ) ;
504
512
if ( ! hostWithWatch . setTimeout ) {
505
513
return ;
@@ -1038,6 +1046,7 @@ namespace ts {
1038
1046
}
1039
1047
1040
1048
function buildAllProjects ( ) : ExitStatus {
1049
+ if ( context . options . watch ) { reportWatchStatus ( Diagnostics . Starting_compilation_in_watch_mode ) ; }
1041
1050
const graph = getGlobalDependencyGraph ( ) ;
1042
1051
if ( graph === undefined ) return ExitStatus . DiagnosticsPresent_OutputsSkipped ;
1043
1052
0 commit comments