In Server when polling the file stat's do not send changed event in case the file doesnt exist.
This commit is contained in:
parent
e500be28cd
commit
6227a36ff0
|
@ -538,7 +538,15 @@ namespace ts.server {
|
||||||
|
|
||||||
fs.stat(watchedFile.fileName, (err: any, stats: any) => {
|
fs.stat(watchedFile.fileName, (err: any, stats: any) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
watchedFile.callback(watchedFile.fileName, FileWatcherEventKind.Changed);
|
if (err.code === "ENOENT") {
|
||||||
|
if (watchedFile.mtime.getTime() !== 0) {
|
||||||
|
watchedFile.mtime = new Date(0);
|
||||||
|
watchedFile.callback(watchedFile.fileName, FileWatcherEventKind.Deleted);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
watchedFile.callback(watchedFile.fileName, FileWatcherEventKind.Changed);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const oldTime = watchedFile.mtime.getTime();
|
const oldTime = watchedFile.mtime.getTime();
|
||||||
|
|
Loading…
Reference in a new issue