@@ -203,17 +203,14 @@ namespace ts {
203
203
TypeRoots = "Type roots"
204
204
}
205
205
206
- interface WatchFactory < X , Y = undefined > extends ts . WatchFactory < X , Y > {
207
- watchLogLevel : WatchLogLevel ;
206
+ interface WatchFactory < X , Y = undefined > extends ts . WatchFactory < X , Y > {
208
207
writeLog : ( s : string ) => void ;
209
208
}
210
209
211
210
export function createWatchFactory < Y = undefined > ( host : { trace ?( s : string ) : void ; } , options : { extendedDiagnostics ?: boolean ; diagnostics ?: boolean ; } ) {
212
- const watchLogLevel = host . trace ? options . extendedDiagnostics ? WatchLogLevel . Verbose :
213
- options . diagnostics ? WatchLogLevel . TriggerOnly : WatchLogLevel . None : WatchLogLevel . None ;
211
+ const watchLogLevel = host . trace ? options . extendedDiagnostics ? WatchLogLevel . Verbose : options . diagnostics ? WatchLogLevel . TriggerOnly : WatchLogLevel . None : WatchLogLevel . None ;
214
212
const writeLog : ( s : string ) => void = watchLogLevel !== WatchLogLevel . None ? ( s => host . trace ! ( s ) ) : noop ;
215
213
const result = getWatchFactory < WatchType , Y > ( watchLogLevel , writeLog ) as WatchFactory < WatchType , Y > ;
216
- result . watchLogLevel = watchLogLevel ;
217
214
result . writeLog = writeLog ;
218
215
return result ;
219
216
}
@@ -590,7 +587,7 @@ namespace ts {
590
587
newLine = updateNewLine ( ) ;
591
588
}
592
589
593
- const { watchFile, watchFilePath, watchDirectory, watchLogLevel , writeLog } = createWatchFactory < string > ( host , compilerOptions ) ;
590
+ const { watchFile, watchFilePath, watchDirectory, writeLog } = createWatchFactory < string > ( host , compilerOptions ) ;
594
591
const getCanonicalFileName = createGetCanonicalFileName ( useCaseSensitiveFileNames ) ;
595
592
596
593
writeLog ( `Current directory: ${ currentDirectory } CaseSensitiveFileNames: ${ useCaseSensitiveFileNames } ` ) ;
@@ -685,11 +682,9 @@ namespace ts {
685
682
686
683
function createNewProgram ( program : Program , hasInvalidatedResolution : HasInvalidatedResolution ) {
687
684
// Compile the program
688
- if ( watchLogLevel !== WatchLogLevel . None ) {
689
- writeLog ( "CreatingProgramWith::" ) ;
690
- writeLog ( ` roots: ${ JSON . stringify ( rootFileNames ) } ` ) ;
691
- writeLog ( ` options: ${ JSON . stringify ( compilerOptions ) } ` ) ;
692
- }
685
+ writeLog ( "CreatingProgramWith::" ) ;
686
+ writeLog ( ` roots: ${ JSON . stringify ( rootFileNames ) } ` ) ;
687
+ writeLog ( ` options: ${ JSON . stringify ( compilerOptions ) } ` ) ;
693
688
694
689
const needsUpdateInTypeRootWatch = hasChangedCompilerOptions || ! program ;
695
690
hasChangedCompilerOptions = false ;
0 commit comments