Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ward <matt.ward@microsoft.com>2019-12-13 13:13:58 +0300
committerMatt Ward <ward.matt@gmail.com>2020-01-14 12:36:01 +0300
commitd2ff688d5979436c18124d9740a23a831bbb59ae (patch)
tree8badab3289c6c74405d49c29848a2259b5c0a75c
parent97e486c9fbd040f504794f21834ccfff6efb494f (diff)
[Core] Handle odd file watcher events causing solution to be closed
The file watcher seems to sometimes produce strange events which look like a directory being renamed to a file. This can cause the IDE to believe the solution file has been deleted since the file service will raise a FileRemoved event for a rename. To avoid this check that the directory does not exist and if it does the FileRemoved event is not fired with this type of rename. Fixes VSTS #1027550 - VSMac keeps closing my solution
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/FileWatcherService.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/FileWatcherService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/FileWatcherService.cs
index c2bf45fd01..b438d3e13d 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/FileWatcherService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/FileWatcherService.cs
@@ -585,7 +585,8 @@ namespace MonoDevelop.Projects
// the original file still exists.
if (File.Exists (e.OldFullPath))
FileService.NotifyFileChanged (e.OldFullPath);
- else
+ // Handle odd file watcher events which look like a folder being renamed to a file.
+ else if (!Directory.Exists (e.OldFullPath))
FileService.NotifyFileRemoved (e.OldFullPath);
}