File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -526,12 +526,18 @@ namespace ts.server {
526
526
if ( err ) {
527
527
watchedFile . callback ( watchedFile . fileName , FileWatcherEventKind . Changed ) ;
528
528
}
529
- else if ( watchedFile . mtime . getTime ( ) !== stats . mtime . getTime ( ) ) {
530
- watchedFile . mtime = stats . mtime ;
531
- const eventKind = watchedFile . mtime . getTime ( ) === 0
532
- ? FileWatcherEventKind . Deleted
533
- : FileWatcherEventKind . Changed ;
534
- watchedFile . callback ( watchedFile . fileName , eventKind ) ;
529
+ else {
530
+ const oldTime = watchedFile . mtime . getTime ( ) ;
531
+ const newTime = stats . mtime . getTime ( ) ;
532
+ if ( oldTime !== newTime ) {
533
+ watchedFile . mtime = stats . mtime ;
534
+ const eventKind = oldTime === 0
535
+ ? FileWatcherEventKind . Created
536
+ : newTime === 0
537
+ ? FileWatcherEventKind . Deleted
538
+ : FileWatcherEventKind . Changed ;
539
+ watchedFile . callback ( watchedFile . fileName , eventKind ) ;
540
+ }
535
541
}
536
542
} ) ;
537
543
}
You can’t perform that action at this time.
0 commit comments