handle ignoring events better
This commit is contained in:
@@ -15,7 +15,16 @@ public class IdeFileChangeHandler
|
||||
{
|
||||
var sharpIdeFile = SolutionModel.AllFiles.SingleOrDefault(f => f.Path == filePath);
|
||||
if (sharpIdeFile is null) return;
|
||||
if (sharpIdeFile.SuppressDiskChangeEvents.Value is true) return;
|
||||
if (sharpIdeFile.SuppressDiskChangeEvents is true) return;
|
||||
if (sharpIdeFile.LastIdeWriteTime is not null)
|
||||
{
|
||||
var now = DateTimeOffset.Now;
|
||||
if (now - sharpIdeFile.LastIdeWriteTime.Value < TimeSpan.FromMilliseconds(300))
|
||||
{
|
||||
Console.WriteLine($"IdeFileChangeHandler: Ignored - {filePath}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
Console.WriteLine($"IdeFileChangeHandler: Changed - {filePath}");
|
||||
await sharpIdeFile.FileContentsChangedExternallyFromDisk.InvokeParallelAsync();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user