Skip to content

Commit

Permalink
Fixed believed issue with watch implementation cc @sheetalkamat
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyreilly committed Jan 20, 2018
1 parent 4a6b0da commit 6d55769
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,16 @@ function updateFileInCache(filePath: string, contents: string, instance: TSInsta
instance.files[filePath] = file;
}
else {
fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Created;
if (instance.watchHost) {
fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Created;
}
file = instance.files[filePath] = <TSFile>{ version: 0 };
}
instance.changedFilesList = true;
}

if (contents === undefined) {
fileWatcherEventKind === instance.compiler.FileWatcherEventKind.Deleted;
if (instance.watchHost && contents === undefined) {
fileWatcherEventKind = instance.compiler.FileWatcherEventKind.Deleted;
}

if (file.text !== contents) {
Expand Down

0 comments on commit 6d55769

Please sign in to comment.