@@ -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 : ( ) => {
@@ -728,7 +728,7 @@ namespace ts {
728
728
( hostSourceFile as FilePresentOnHost ) . sourceFile = sourceFile ;
729
729
sourceFile . version = hostSourceFile . version . toString ( ) ;
730
730
if ( ! ( hostSourceFile as FilePresentOnHost ) . fileWatcher ) {
731
- ( hostSourceFile as FilePresentOnHost ) . fileWatcher = watchFilePath ( host , fileName , onSourceFileChange , PollingInterval . Low , path ) ;
731
+ ( hostSourceFile as FilePresentOnHost ) . fileWatcher = watchFilePath ( host , fileName , onSourceFileChange , PollingInterval . Low , path , "Source file" ) ;
732
732
}
733
733
}
734
734
else {
@@ -742,7 +742,7 @@ namespace ts {
742
742
else {
743
743
if ( sourceFile ) {
744
744
sourceFile . version = initialVersion . toString ( ) ;
745
- const fileWatcher = watchFilePath ( host , fileName , onSourceFileChange , PollingInterval . Low , path ) ;
745
+ const fileWatcher = watchFilePath ( host , fileName , onSourceFileChange , PollingInterval . Low , path , "Source file" ) ;
746
746
sourceFilesCache . set ( path , { sourceFile, version : initialVersion , fileWatcher } ) ;
747
747
}
748
748
else {
@@ -827,6 +827,7 @@ namespace ts {
827
827
if ( timerToUpdateProgram ) {
828
828
host . clearTimeout ( timerToUpdateProgram ) ;
829
829
}
830
+ writeLog ( "Scheduling update" ) ;
830
831
timerToUpdateProgram = host . setTimeout ( updateProgram , 250 ) ;
831
832
}
832
833
@@ -852,6 +853,7 @@ namespace ts {
852
853
}
853
854
854
855
function reloadFileNamesFromConfigFile ( ) {
856
+ writeLog ( "Reloading new file names and options" ) ;
855
857
const result = getFileNamesFromConfigSpecs ( configFileSpecs , getDirectoryPath ( configFileName ) , compilerOptions , parseConfigFileHost ) ;
856
858
if ( result . fileNames . length ) {
857
859
configFileParsingDiagnostics = filter ( configFileParsingDiagnostics , error => ! isErrorNoInputFiles ( error ) ) ;
@@ -913,12 +915,8 @@ namespace ts {
913
915
}
914
916
}
915
917
916
- function watchDirectory ( directory : string , cb : DirectoryWatcherCallback , flags : WatchDirectoryFlags ) {
917
- return watchDirectoryWorker ( host , directory , cb , flags ) ;
918
- }
919
-
920
918
function watchMissingFilePath ( missingFilePath : Path ) {
921
- return watchFilePath ( host , missingFilePath , onMissingFileChange , PollingInterval . Medium , missingFilePath ) ;
919
+ return watchFilePath ( host , missingFilePath , onMissingFileChange , PollingInterval . Medium , missingFilePath , "Missing file" ) ;
922
920
}
923
921
924
922
function onMissingFileChange ( fileName : string , eventKind : FileWatcherEventKind , missingFilePath : Path ) {
@@ -951,6 +949,7 @@ namespace ts {
951
949
952
950
function watchWildcardDirectory ( directory : string , flags : WatchDirectoryFlags ) {
953
951
return watchDirectory (
952
+ host ,
954
953
directory ,
955
954
fileOrDirectory => {
956
955
Debug . assert ( ! ! configFileName ) ;
@@ -978,7 +977,8 @@ namespace ts {
978
977
scheduleProgramUpdate ( ) ;
979
978
}
980
979
} ,
981
- flags
980
+ flags ,
981
+ "Wild card directories"
982
982
) ;
983
983
}
984
984
0 commit comments