@@ -365,7 +365,8 @@ namespace ts.server {
365365
366366 private onTypeRootFileChanged ( project : ConfiguredProject , fileName : string ) {
367367 this . logger . info ( `Type root file ${ fileName } changed` ) ;
368- this . throttledOperations . schedule ( project . configFileName , /*delay*/ 250 , ( ) => {
368+ this . throttledOperations . schedule ( project . configFileName + ' * type root' , /*delay*/ 250 , ( ) => {
369+ project . updateTypes ( ) ;
369370 this . updateConfiguredProject ( project ) ;
370371 this . refreshInferredProjects ( ) ;
371372 } ) ;
@@ -391,20 +392,15 @@ namespace ts.server {
391392 ( ) => this . handleChangeInSourceFileForConfiguredProject ( project ) ) ;
392393 }
393394
394- getTypeRootsVersion ( project : ConfiguredProject ) {
395- return server . getLatestDirectoryChangeTime ( project . getEffectiveTypeRoots ( ) , this . host ) ;
396- }
397-
398395 private handleChangeInSourceFileForConfiguredProject ( project : ConfiguredProject ) {
399396 const { projectOptions, configFileErrors } = this . convertConfigFileContentToProjectOptions ( project . configFileName ) ;
400397 this . reportConfigFileDiagnostics ( project . getProjectName ( ) , configFileErrors ) ;
401398
402399 const newRootFiles = projectOptions . files . map ( ( f => this . getCanonicalFileName ( f ) ) ) ;
403400 const currentRootFiles = project . getRootFiles ( ) . map ( ( f => this . getCanonicalFileName ( f ) ) ) ;
404- const lastUpdateTypesRoot : number = this . getTypeRootsVersion ( project ) ;
405401
406402 // We check if the project file list has changed. If so, we update the project.
407- if ( ! arrayIsEqualTo ( currentRootFiles . sort ( ) , newRootFiles . sort ( ) ) || ( lastUpdateTypesRoot > project . lastUpdatedTypesRootTime ) ) {
403+ if ( ! arrayIsEqualTo ( currentRootFiles . sort ( ) , newRootFiles . sort ( ) ) ) {
408404 // For configured projects, the change is made outside the tsconfig file, and
409405 // it is not likely to affect the project for other files opened by the client. We can
410406 // just update the current project.
@@ -415,8 +411,6 @@ namespace ts.server {
415411 // Call refreshInferredProjects to clean up inferred projects we may have
416412 // created for the new files
417413 this . refreshInferredProjects ( ) ;
418-
419- project . lastUpdatedTypesRootTime = lastUpdateTypesRoot ;
420414 }
421415 }
422416
0 commit comments