@@ -531,13 +531,13 @@ namespace ts {
531
531
const watchLogLevel = trace ? compilerOptions . extendedDiagnostics ? WatchLogLevel . Verbose :
532
532
compilerOptions . diagnostis ? WatchLogLevel . TriggerOnly : WatchLogLevel . None : WatchLogLevel . None ;
533
533
const writeLog : ( s : string ) => void = watchLogLevel !== WatchLogLevel . None ? trace : noop ;
534
- const { watchFile, watchFilePath, watchDirectory : watchDirectoryWorker } = getWatchFactory ( watchLogLevel , writeLog ) ;
534
+ const { watchFile, watchFilePath, watchDirectory } = getWatchFactory < string > ( watchLogLevel , writeLog ) ;
535
535
536
536
const getCanonicalFileName = createGetCanonicalFileName ( useCaseSensitiveFileNames ) ;
537
537
538
538
writeLog ( `Current directory: ${ currentDirectory } CaseSensitiveFileNames: ${ useCaseSensitiveFileNames } ` ) ;
539
539
if ( configFileName ) {
540
- watchFile ( host , configFileName , scheduleProgramReload , PollingInterval . High ) ;
540
+ watchFile ( host , configFileName , scheduleProgramReload , PollingInterval . High , "Config file" ) ;
541
541
}
542
542
543
543
const compilerHost : CompilerHost & ResolutionCacheHost = {
@@ -563,8 +563,8 @@ namespace ts {
563
563
// Members for ResolutionCacheHost
564
564
toPath,
565
565
getCompilationSettings : ( ) => compilerOptions ,
566
- watchDirectoryOfFailedLookupLocation : watchDirectory ,
567
- watchTypeRootsDirectory : watchDirectory ,
566
+ watchDirectoryOfFailedLookupLocation : ( dir , cb , flags ) => watchDirectory ( host , dir , cb , flags , "Failed Lookup Locations" ) ,
567
+ watchTypeRootsDirectory : ( dir , cb , flags ) => watchDirectory ( host , dir , cb , flags , "Type roots" ) ,
568
568
getCachedDirectoryStructureHost : ( ) => cachedDirectoryStructureHost ,
569
569
onInvalidatedResolution : scheduleProgramUpdate ,
570
570
onChangedAutomaticTypeDirectiveNames : ( ) => {
@@ -724,7 +724,7 @@ namespace ts {
724
724
( hostSourceFile as FilePresentOnHost ) . sourceFile = sourceFile ;
725
725
sourceFile . version = hostSourceFile . version . toString ( ) ;
726
726
if ( ! ( hostSourceFile as FilePresentOnHost ) . fileWatcher ) {
727
- ( hostSourceFile as FilePresentOnHost ) . fileWatcher = watchFilePath ( host , fileName , onSourceFileChange , PollingInterval . Low , path ) ;
727
+ ( hostSourceFile as FilePresentOnHost ) . fileWatcher = watchFilePath ( host , fileName , onSourceFileChange , PollingInterval . Low , path , "Source file" ) ;
728
728
}
729
729
}
730
730
else {
@@ -738,7 +738,7 @@ namespace ts {
738
738
else {
739
739
if ( sourceFile ) {
740
740
sourceFile . version = initialVersion . toString ( ) ;
741
- const fileWatcher = watchFilePath ( host , fileName , onSourceFileChange , PollingInterval . Low , path ) ;
741
+ const fileWatcher = watchFilePath ( host , fileName , onSourceFileChange , PollingInterval . Low , path , "Source file" ) ;
742
742
sourceFilesCache . set ( path , { sourceFile, version : initialVersion , fileWatcher } ) ;
743
743
}
744
744
else {
@@ -823,6 +823,7 @@ namespace ts {
823
823
if ( timerToUpdateProgram ) {
824
824
host . clearTimeout ( timerToUpdateProgram ) ;
825
825
}
826
+ writeLog ( "Scheduling update" ) ;
826
827
timerToUpdateProgram = host . setTimeout ( updateProgram , 250 ) ;
827
828
}
828
829
@@ -848,6 +849,7 @@ namespace ts {
848
849
}
849
850
850
851
function reloadFileNamesFromConfigFile ( ) {
852
+ writeLog ( "Reloading new file names and options" ) ;
851
853
const result = getFileNamesFromConfigSpecs ( configFileSpecs , getDirectoryPath ( configFileName ) , compilerOptions , parseConfigFileHost ) ;
852
854
if ( result . fileNames . length ) {
853
855
configFileParsingDiagnostics = filter ( configFileParsingDiagnostics , error => ! isErrorNoInputFiles ( error ) ) ;
@@ -909,12 +911,8 @@ namespace ts {
909
911
}
910
912
}
911
913
912
- function watchDirectory ( directory : string , cb : DirectoryWatcherCallback , flags : WatchDirectoryFlags ) {
913
- return watchDirectoryWorker ( host , directory , cb , flags ) ;
914
- }
915
-
916
914
function watchMissingFilePath ( missingFilePath : Path ) {
917
- return watchFilePath ( host , missingFilePath , onMissingFileChange , PollingInterval . Medium , missingFilePath ) ;
915
+ return watchFilePath ( host , missingFilePath , onMissingFileChange , PollingInterval . Medium , missingFilePath , "Missing file" ) ;
918
916
}
919
917
920
918
function onMissingFileChange ( fileName : string , eventKind : FileWatcherEventKind , missingFilePath : Path ) {
@@ -947,6 +945,7 @@ namespace ts {
947
945
948
946
function watchWildcardDirectory ( directory : string , flags : WatchDirectoryFlags ) {
949
947
return watchDirectory (
948
+ host ,
950
949
directory ,
951
950
fileOrDirectory => {
952
951
Debug . assert ( ! ! configFileName ) ;
@@ -974,7 +973,8 @@ namespace ts {
974
973
scheduleProgramUpdate ( ) ;
975
974
}
976
975
} ,
977
- flags
976
+ flags ,
977
+ "Wild card directories"
978
978
) ;
979
979
}
980
980
0 commit comments