@@ -246,7 +246,7 @@ namespace ts.server {
246246 export const enum WatchType {
247247 ConfigFilePath = "Config file for the program" ,
248248 MissingFilePath = "Missing file from program" ,
249- WildCardDirectories = "Wild card directory" ,
249+ WildcardDirectories = "Wild card directory" ,
250250 TypeRoot = "Type root of the project" ,
251251 ClosedScriptInfo = "Closed Script info" ,
252252 ConfigFileForInferredRoot = "Config file for the inferred project root"
@@ -363,7 +363,7 @@ namespace ts.server {
363363 * - Or it is present if we have configured project open with config file at that location
364364 * In this case the exists property is always true
365365 */
366- private readonly mapOfConfigFileExistenceInfo = createMap < ConfigFileExistenceInfo > ( ) ;
366+ private readonly configFileExistenceInfoCache = createMap < ConfigFileExistenceInfo > ( ) ;
367367 private readonly throttledOperations : ThrottledOperations ;
368368
369369 private readonly hostConfiguration : HostConfiguration ;
@@ -693,7 +693,7 @@ namespace ts.server {
693693 }
694694
695695 private onConfigChangedForConfiguredProject ( project : ConfiguredProject , eventKind : FileWatcherEventKind ) {
696- const configFileExistenceInfo = this . mapOfConfigFileExistenceInfo . get ( project . canonicalConfigFilePath ) ;
696+ const configFileExistenceInfo = this . configFileExistenceInfoCache . get ( project . canonicalConfigFilePath ) ;
697697 if ( eventKind === FileWatcherEventKind . Deleted ) {
698698 // Update the cached status
699699 // We arent updating or removing the cached config file presence info as that will be taken care of by
@@ -725,7 +725,7 @@ namespace ts.server {
725725 private onConfigFileChangeForOpenScriptInfo ( configFileName : NormalizedPath , eventKind : FileWatcherEventKind ) {
726726 // This callback is called only if we dont have config file project for this config file
727727 const canonicalConfigPath = normalizedPathToPath ( configFileName , this . currentDirectory , this . toCanonicalFileName ) ;
728- const configFileExistenceInfo = this . mapOfConfigFileExistenceInfo . get ( canonicalConfigPath ) ;
728+ const configFileExistenceInfo = this . configFileExistenceInfoCache . get ( canonicalConfigPath ) ;
729729 configFileExistenceInfo . exists = ( eventKind !== FileWatcherEventKind . Deleted ) ;
730730 this . logConfigFileWatchUpdate ( configFileName , canonicalConfigPath , configFileExistenceInfo , ConfigFileWatcherStatus . ReloadingFiles ) ;
731731
@@ -852,7 +852,7 @@ namespace ts.server {
852852 }
853853
854854 private configFileExists ( configFileName : NormalizedPath , canonicalConfigFilePath : string , info : ScriptInfo ) {
855- let configFileExistenceInfo = this . mapOfConfigFileExistenceInfo . get ( canonicalConfigFilePath ) ;
855+ let configFileExistenceInfo = this . configFileExistenceInfoCache . get ( canonicalConfigFilePath ) ;
856856 if ( configFileExistenceInfo ) {
857857 // By default the info would get impacted by presence of config file since its in the detection path
858858 // Only adding the info as a root to inferred project will need the existence to be watched by file watcher
@@ -877,13 +877,13 @@ namespace ts.server {
877877 openFilesImpactedByConfigFile . set ( info . path , false ) ;
878878 const exists = this . host . fileExists ( configFileName ) ;
879879 configFileExistenceInfo = { exists, openFilesImpactedByConfigFile } ;
880- this . mapOfConfigFileExistenceInfo . set ( canonicalConfigFilePath , configFileExistenceInfo ) ;
880+ this . configFileExistenceInfoCache . set ( canonicalConfigFilePath , configFileExistenceInfo ) ;
881881 this . logConfigFileWatchUpdate ( configFileName , canonicalConfigFilePath , configFileExistenceInfo , ConfigFileWatcherStatus . OpenFilesImpactedByConfigFileAdd ) ;
882882 return exists ;
883883 }
884884
885885 private setConfigFileExistenceByNewConfiguredProject ( project : ConfiguredProject ) {
886- const configFileExistenceInfo = this . mapOfConfigFileExistenceInfo . get ( project . canonicalConfigFilePath ) ;
886+ const configFileExistenceInfo = this . configFileExistenceInfoCache . get ( project . canonicalConfigFilePath ) ;
887887 if ( configFileExistenceInfo ) {
888888 Debug . assert ( configFileExistenceInfo . exists ) ;
889889 // close existing watcher
@@ -900,7 +900,7 @@ namespace ts.server {
900900 else {
901901 // We could be in this scenario if project is the configured project tracked by external project
902902 // Since that route doesnt check if the config file is present or not
903- this . mapOfConfigFileExistenceInfo . set ( project . canonicalConfigFilePath , {
903+ this . configFileExistenceInfoCache . set ( project . canonicalConfigFilePath , {
904904 exists : true ,
905905 openFilesImpactedByConfigFile : createMap < boolean > ( )
906906 } ) ;
@@ -915,7 +915,7 @@ namespace ts.server {
915915 }
916916
917917 private setConfigFileExistenceInfoByClosedConfiguredProject ( closedProject : ConfiguredProject ) {
918- const configFileExistenceInfo = this . mapOfConfigFileExistenceInfo . get ( closedProject . canonicalConfigFilePath ) ;
918+ const configFileExistenceInfo = this . configFileExistenceInfoCache . get ( closedProject . canonicalConfigFilePath ) ;
919919 Debug . assert ( ! ! configFileExistenceInfo ) ;
920920 if ( configFileExistenceInfo . openFilesImpactedByConfigFile . size ) {
921921 const configFileName = closedProject . getConfigFilePath ( ) ;
@@ -933,7 +933,7 @@ namespace ts.server {
933933 }
934934 else {
935935 // There is not a single file open thats tracking the status of this config file. Remove from cache
936- this . mapOfConfigFileExistenceInfo . delete ( closedProject . canonicalConfigFilePath ) ;
936+ this . configFileExistenceInfoCache . delete ( closedProject . canonicalConfigFilePath ) ;
937937 }
938938 }
939939
@@ -983,7 +983,7 @@ namespace ts.server {
983983 private stopWatchingConfigFilesForClosedScriptInfo ( info : ScriptInfo ) {
984984 Debug . assert ( ! info . isScriptOpen ( ) ) ;
985985 this . forEachConfigFileLocation ( info , ( configFileName , canonicalConfigFilePath ) => {
986- const configFileExistenceInfo = this . mapOfConfigFileExistenceInfo . get ( canonicalConfigFilePath ) ;
986+ const configFileExistenceInfo = this . configFileExistenceInfoCache . get ( canonicalConfigFilePath ) ;
987987 if ( configFileExistenceInfo ) {
988988 const infoIsRootOfInferredProject = configFileExistenceInfo . openFilesImpactedByConfigFile . get ( info . path ) ;
989989
@@ -1006,7 +1006,7 @@ namespace ts.server {
10061006 if ( ! configFileExistenceInfo . openFilesImpactedByConfigFile . size &&
10071007 ! this . getConfiguredProjectByCanonicalConfigFilePath ( canonicalConfigFilePath ) ) {
10081008 Debug . assert ( ! configFileExistenceInfo . configFileWatcherForRootOfInferredProject ) ;
1009- this . mapOfConfigFileExistenceInfo . delete ( canonicalConfigFilePath ) ;
1009+ this . configFileExistenceInfoCache . delete ( canonicalConfigFilePath ) ;
10101010 }
10111011 }
10121012 } ) ;
@@ -1019,14 +1019,14 @@ namespace ts.server {
10191019 startWatchingConfigFilesForInferredProjectRoot ( info : ScriptInfo ) {
10201020 Debug . assert ( info . isScriptOpen ( ) ) ;
10211021 this . forEachConfigFileLocation ( info , ( configFileName , canonicalConfigFilePath ) => {
1022- let configFilePresenceInfo = this . mapOfConfigFileExistenceInfo . get ( canonicalConfigFilePath ) ;
1022+ let configFilePresenceInfo = this . configFileExistenceInfoCache . get ( canonicalConfigFilePath ) ;
10231023 if ( ! configFilePresenceInfo ) {
10241024 // Create the cache
10251025 configFilePresenceInfo = {
10261026 exists : this . host . fileExists ( configFileName ) ,
10271027 openFilesImpactedByConfigFile : createMap < boolean > ( )
10281028 } ;
1029- this . mapOfConfigFileExistenceInfo . set ( canonicalConfigFilePath , configFilePresenceInfo ) ;
1029+ this . configFileExistenceInfoCache . set ( canonicalConfigFilePath , configFilePresenceInfo ) ;
10301030 }
10311031
10321032 // Set this file as the root of inferred project
@@ -1050,7 +1050,7 @@ namespace ts.server {
10501050 /* @internal */
10511051 stopWatchingConfigFilesForInferredProjectRoot ( info : ScriptInfo , reason : WatcherCloseReason ) {
10521052 this . forEachConfigFileLocation ( info , ( configFileName , canonicalConfigFilePath ) => {
1053- const configFileExistenceInfo = this . mapOfConfigFileExistenceInfo . get ( canonicalConfigFilePath ) ;
1053+ const configFileExistenceInfo = this . configFileExistenceInfoCache . get ( canonicalConfigFilePath ) ;
10541054 if ( configFileExistenceInfo && configFileExistenceInfo . openFilesImpactedByConfigFile . has ( info . path ) ) {
10551055 Debug . assert ( info . isScriptOpen ( ) ) ;
10561056
@@ -1607,14 +1607,14 @@ namespace ts.server {
16071607
16081608 /* @internal */
16091609 closeDirectoryWatcher ( watchType : WatchType , project : Project , directory : string , watcher : FileWatcher , flags : WatchDirectoryFlags , reason : WatcherCloseReason ) {
1610- const recursive = isRecursiveDirectoryWatch ( flags ) ;
1610+ const recursive = ( flags & WatchDirectoryFlags . Recursive ) !== 0 ;
16111611 this . logger . info ( `DirectoryWatcher ${ recursive ? "recursive" : "" } :: Close: ${ directory } Project: ${ project . getProjectName ( ) } WatchType: ${ watchType } Reason: ${ reason } ` ) ;
16121612 watcher . close ( ) ;
16131613 }
16141614
16151615 /* @internal */
16161616 addDirectoryWatcher ( watchType : WatchType , project : Project , directory : string , cb : ServerDirectoryWatcherCallback , flags : WatchDirectoryFlags ) {
1617- const recursive = isRecursiveDirectoryWatch ( flags ) ;
1617+ const recursive = ( flags & WatchDirectoryFlags . Recursive ) !== 0 ;
16181618 this . logger . info ( `DirectoryWatcher ${ recursive ? "recursive" : "" } :: Added: ${ directory } Project: ${ project . getProjectName ( ) } WatchType: ${ watchType } ` ) ;
16191619 return this . host . watchDirectory ( directory , fileName => {
16201620 const path = toNormalizedPath ( getNormalizedAbsolutePath ( fileName , directory ) ) ;
0 commit comments