-
Notifications
You must be signed in to change notification settings - Fork 1k
Commits on May 29, 2018
-
[Core] Use .dylib for native file watcher
Previously the native file watcher was statically linked into monostub. This meant that the unit tests were not using the native file watcher but the one provided by Mono. Switching to a dylib allows the unit tests to use the native file watcher. If the dylib is missing then the Mono file watcher will be used.
Configuration menu - View commit details
-
Copy full SHA for 594e27b - Browse repository at this point
Copy the full SHA 594e27bView commit details -
[Core] Ensure native file watcher is used in tests
Added test that checks the native file watcher is available in unit tests.
Configuration menu - View commit details
-
Copy full SHA for f799628 - Browse repository at this point
Copy the full SHA f799628View commit details -
[Core] Allow a solution to be monitored by the file watcher
Added a simple way to register a solution so all files in its directories are monitored. Only file change events are passed to the FileService which are then raised as events by the FileService. Added some tests to verify that modify a project inside a solution or a file inside the project generates FileService FileChanged events. The tests that use Project.SaveAsync pass without the new file watcher since the FileService is called directly to notify file changes when SolutionItem.DoSave is called and MSBuildProject.SaveAsync is called, which uses TextFile.Write which generates the event. The direct calls to notify the FileService have not yet been removed.
Configuration menu - View commit details
-
Copy full SHA for 488bacb - Browse repository at this point
Copy the full SHA 488bacbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 09288dc - Browse repository at this point
Copy the full SHA 09288dcView commit details -
[Core] Support file deletion notifications from file watcher
Registering a solution with the file watcher will generate file remove events from the FileService. Note that currently file remove events are generated on saving a file which has not yet been addressed. The new tests also seem to break the SaveFileInProjectExternally test - no change event is fired when saving a file using TextFileUtility.WriteText.
Configuration menu - View commit details
-
Copy full SHA for 46aa507 - Browse repository at this point
Copy the full SHA 46aa507View commit details -
[Core] Treat temp file rename as a change event in file watcher
The TextFileUtility creates a temp file in the same directory as the file being saved but changes the filename so it starts with '.#' The native file watcher on Mac does not always generate a change event when a file is saved using the TextFileUtility so we treat a rename event of the temp file to the file being saved as a change event that will be raised by FileService.FileChanged. This fixes the SaveFileInProjectExternally test that was failing.
Configuration menu - View commit details
-
Copy full SHA for fce1c38 - Browse repository at this point
Copy the full SHA fce1c38View commit details -
[Core] WorkspaceItem now registers itself with the file watcher
On opening a solution it has a file watcher created. When the solution is disposed the file watcher is removed.
Configuration menu - View commit details
-
Copy full SHA for a988e9d - Browse repository at this point
Copy the full SHA a988e9dView commit details -
[Ide] Use file watcher to detect changes instead of checking all files
Removed the code that checked all the files belonging to open solution when the IDE lost focus, or a build was started, then checked for modified or removed files on regaining focus or the build completes. This is now handled by the file watcher for the solution. Note that in the case of the IDE losing focus the file events are frozen until the IDE gets focus again.
Configuration menu - View commit details
-
Copy full SHA for 7c2e513 - Browse repository at this point
Copy the full SHA 7c2e513View commit details -
[Ide] Fix file open in text editor being reloaded on save
Check the last write time of the file before reloading it to handle change events being generated by the file watcher. Also no need to generate a file change event directly in the Document class since one is generated by the file watcher.
Configuration menu - View commit details
-
Copy full SHA for 34a011f - Browse repository at this point
Copy the full SHA 34a011fView commit details -
[Core] Fix invalid cast after thawing FileService events
When different FileService event types (e.g. copy followed by a change event) occurred when the FileService was frozen on thawing the attempt to merge similar events together would fail since the cast to EventData<TArgs> would not work for different event types. System.InvalidCastException: Specified cast is not valid. at MonoDevelop.Core.EventQueue+EventData`1[TArgs].ShouldMerge (MonoDevelop.Core.EventQueue+EventData other) in main/src/core/MonoDevelop.Core/MonoDevelop.Core/FileService.cs:865 at MonoDevelop.Core.EventQueue.Thaw ()
Configuration menu - View commit details
-
Copy full SHA for 526186e - Browse repository at this point
Copy the full SHA 526186eView commit details -
[Core] Watch files outside the solution directory
Handle projects and files that exist outside the solution directory when watching files. File watchers are now created for all directories that are needed instead of just for the solution's directory. Currently the directory information is cached in the WorkspaceItem and not updated when a new project or file is added or removed.
Configuration menu - View commit details
-
Copy full SHA for aedbd57 - Browse repository at this point
Copy the full SHA aedbd57View commit details -
[Tests] Dispose solution in file watcher test instead of removing it
The test was directly removing the solution from the file watcher service. Now the solution is disposed which will remove the solution from the file watcher.
Configuration menu - View commit details
-
Copy full SHA for cb7a257 - Browse repository at this point
Copy the full SHA cb7a257View commit details -
[Core] Handle multiple solutions opened with file watchers
Initial simplistic handling of multiple solutions being opened which share a common directory.
Configuration menu - View commit details
-
Copy full SHA for 4247c99 - Browse repository at this point
Copy the full SHA 4247c99View commit details -
[Core] Normalize file watchers for multiple solutions
Ensure that the directories watched are normalized so a directory is not monitored more than once which would result in duplicate file events being generated.
Configuration menu - View commit details
-
Copy full SHA for 1fc0361 - Browse repository at this point
Copy the full SHA 1fc0361View commit details -
[Core] Re-normalize file watcher directories on solution close
This fixes the file watcher being disabled for a solution when another solution was closed and exists in a directory that is a parent of the other solution.
Configuration menu - View commit details
-
Copy full SHA for 9c2ccfb - Browse repository at this point
Copy the full SHA 9c2ccfbView commit details -
[Core] Allow directories to be watched
Allow directories to be watched without having to have them belonging to a solution. This allows documents to be monitored for changes when they do not belong to a solution.
Configuration menu - View commit details
-
Copy full SHA for f853afc - Browse repository at this point
Copy the full SHA f853afcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5180437 - Browse repository at this point
Copy the full SHA 5180437View commit details -
[Core] RootWorkspace now adds solutions to the file watcher
Previously the workspace item was registering itself with the file watcher. This was causing tests to hang since some solutions are not disposed.
Configuration menu - View commit details
-
Copy full SHA for 7762eb3 - Browse repository at this point
Copy the full SHA 7762eb3View commit details -
[Core] File watcher now handles adhoc solutions being disposed
Adhoc solutions are not registered with the file watcher and when they were disposed were triggering an update of the file watchers. Now a check is made to see if the solution is being watched before updating the file watchers.
Configuration menu - View commit details
-
Copy full SHA for 921a37e - Browse repository at this point
Copy the full SHA 921a37eView commit details -
[Ide] Handle filename being changed with save as when being watched
Refresh the file watchers after the file in the text editor is saved as another file somewhere else.
Configuration menu - View commit details
-
Copy full SHA for 1d1891b - Browse repository at this point
Copy the full SHA 1d1891bView commit details -
[Core] Update file watchers on project added/removed to/from solution
Refresh the directories monitored when a project is added to a solution or removed from a solution.
Configuration menu - View commit details
-
Copy full SHA for 55fdc6e - Browse repository at this point
Copy the full SHA 55fdc6eView commit details -
[Core] Update file watchers when solution added to workspace
Refresh the file watchers when the workspace has a solution added to it or removed from it.
Configuration menu - View commit details
-
Copy full SHA for b8857f5 - Browse repository at this point
Copy the full SHA b8857f5View commit details -
[Core] Update file watchers after adding file to project
When a file is added to a project or removed from a project the file watchers are now refreshed. Currently the logic is very simple - any file added or removed will cause a refresh. This could be improved.
Configuration menu - View commit details
-
Copy full SHA for cf094b7 - Browse repository at this point
Copy the full SHA cf094b7View commit details -
[Core] Fix no file reload when file modified externally
Some applications, such as TextEdit.app, will create a backup file and then rename that to the original file. This results in no file change event being generated by the file watcher. To handle this a rename is treated as a file change for the destination file.
Configuration menu - View commit details
-
Copy full SHA for 9ec5506 - Browse repository at this point
Copy the full SHA 9ec5506View commit details -
[Core] Fix missing file change events
The FileService was merging the file events to the previous event not the next one. So if there was one change for file 1 followed by a change for file 2 the FileService would lose the change for file 1.
Configuration menu - View commit details
-
Copy full SHA for 257395b - Browse repository at this point
Copy the full SHA 257395bView commit details -
[Core] Mark RootWorkspace.GetFileStatusTracker as obsolete
File events are generated now for all open documents and solutions so the GetFileStatusTracker is not needed.
Configuration menu - View commit details
-
Copy full SHA for 8ba6603 - Browse repository at this point
Copy the full SHA 8ba6603View commit details -
[Git] Stop using FileStatusTracker when working with stashes
The file watcher will now generate the required Changed and Deleted events. Freezing and Thawing the FileService to get the same behaviour as before when the FileService notifications were applied after the stash was applied. Behaviour is a bit broken here compared with before. The native file watcher seems to want to generate - FileChanged, FileCreated and FileDeleted. This results in any open documents that were changed by the stash to be closed. Previously these would be reloaded. The native file watcher gets a changed, created and deleted event flag in the same message and then fires three events - changed, created and deleted event even though the file exists.
Configuration menu - View commit details
-
Copy full SHA for 81c2083 - Browse repository at this point
Copy the full SHA 81c2083View commit details -
[Core] Fix file removed event fired when file not deleted
The native file watcher sometimes generates Changed, Created and Deleted events in that order from a single native file event. This can occur even when the file is not deleted. Sometimes you can trigger this behaviour using File.WriteAllText when the file does not exist. Now a check is made to ensure the file does not exist before the file watcher deleted event handler raises the FileRemoved event with the FileService.
Configuration menu - View commit details
-
Copy full SHA for 84d167a - Browse repository at this point
Copy the full SHA 84d167aView commit details -
[Core] Fix failure to open Git Status window
The Git StatusView indicates it has a file but the parent directory of the filename is null. This was not handled by the file watcher and resulted in the Git status window not being displayed. In the IDE log an IndexOutOfRangeException was thrown: Error while executing command: Review Solution and Commit System.IndexOutOfRangeException: Index was outside the bounds of the array. at MonoDevelop.Core.FilePath.IsChildPathOf (MonoDevelop.Core.FilePath basePath) in MonoDevelop.Core/FilePath.cs:180
Configuration menu - View commit details
-
Copy full SHA for 1ed62bd - Browse repository at this point
Copy the full SHA 1ed62bdView commit details -
[Core] Fix file not being closed when deleted externally
Deleting a file externally on the Mac is treated as a move to the ~/.Trashes directory. This rename event was being ignored so the file was not being closed on switching back to the IDE. Now a delete event is fired by the FileService for the original file when it is renamed.
Configuration menu - View commit details
-
Copy full SHA for 904180e - Browse repository at this point
Copy the full SHA 904180eView commit details -
[Core] Improve speed of file watcher tests
The tests were taking about 2 minutes to run. Now they take about 25 seconds. The problem was that the tests were timing out when waiting for file events instead of continuing when a particular file event occurred. Also the native file watcher will sometimes generate file events out of sequence so this is now handled in the tests by waiting for multiple file events before continuing.
Configuration menu - View commit details
-
Copy full SHA for 98b9bd4 - Browse repository at this point
Copy the full SHA 98b9bd4View commit details -
[Core] FileStatusTracker now uses FileService.FileChanged events
The FileService.FileChanged events are now generated by the file watcher. The FileStatusTracker is used by WorkspaceItem and SolutionItem. It has been changed so that it uses the file changed event to detect if the item needs to be reloaded. Previously it would check the last write time of the item every time NeedsReload was called. The reload required event is not being generated - this was not being fired before.
Configuration menu - View commit details
-
Copy full SHA for f3d4850 - Browse repository at this point
Copy the full SHA f3d4850View commit details -
Configuration menu - View commit details
-
Copy full SHA for 91cadcd - Browse repository at this point
Copy the full SHA 91cadcdView commit details -
[Core] Fix crash when trying to watch missing directory
The native file system watcher will throw an ArgumentException in its constructor if the directory does not exist. So missing directories are now ignored when monitoring files. For example, a linked file might be in a directory that does not exist. An attempt was made to monitor this directory which would cause a crash.
Configuration menu - View commit details
-
Copy full SHA for f23b71c - Browse repository at this point
Copy the full SHA f23b71cView commit details -
[Core] Handle saving file externally generating events out of order
Saving a file in TextEdit.app will sometimes cause a rename event out or order where the last rename is a rename of the original file to a temp file. This was causing the file to be closed in the IDE even though the file was not deleted. To handle this a check is made to ensure the file has been deleted before raising the FileService FileRemoved event.
Configuration menu - View commit details
-
Copy full SHA for 23f6e7c - Browse repository at this point
Copy the full SHA 23f6e7cView commit details -
[Core] Fix project not being reloaded when changed externally
Editing the .csproj file externally was not resulting in the project being reloaded in the IDE. The FileService.FileChanged event was used by the RootWorkspace before the FileStatusTracker processed the same event so the NeedsReload was not true. As a workaround the FileService.FileChanged event is registered by the workspace item first.
Configuration menu - View commit details
-
Copy full SHA for fd56afd - Browse repository at this point
Copy the full SHA fd56afdView commit details -
[Core] RootWorkspace now uses ReloadRequired events
The RootWorkspace no longer uses the FileService.FileChanged to detect a reload is need for solutions or projects. Instead it uses the solution's ReloadRequired and ItemReloadRequired events. The ReloadRequired event is fired by the FileStatusTracker when the solution file is changed externally. The ItemReloadRequired event is fired by the FileStatusTracker for any solution item if its file is changed externally.
Configuration menu - View commit details
-
Copy full SHA for 8324211 - Browse repository at this point
Copy the full SHA 8324211View commit details -
[Core] File watcher now uses tasks
Use a task when updating the file watchers. Previously the file watchers were updated on the UI thread. For large projects, such as Main.sln, this would block the UI for ~1.6 seconds.
Configuration menu - View commit details
-
Copy full SHA for 11e9704 - Browse repository at this point
Copy the full SHA 11e9704View commit details -
[Core] Rely on file watcher for change events in PerformGeneratorAsync
The Project's PerformGeneratorAsync no longer checks all the files in the project in order to generate file change events. This is now handled by the file watcher. PerformGeneratorAsync calls GetProjectFileTimestamps to get a list of files and their timestamps. When the solution is loaded, PerformGeneratorAsync is executed in parallel for many files. The result is that generated files are all modified more or less at once, so when checking timestamps, all generated files will be detected as modified by all generators, so each generator will send change notifications for all modified files of all generators. That is, if the generator is run for N files, there will be NxN notifications of file changes. Using the file watcher with a Xamarin.Forms project seems to generate three file changed events for the .xaml.g.cs file. Fixes VSTS #619697 - UI freeze after opening solution
Configuration menu - View commit details
-
Copy full SHA for 1f2aa30 - Browse repository at this point
Copy the full SHA 1f2aa30View commit details -
[NuGet] Remove FileService notify calls
Rely on the file watcher to generate file change events for packages.config, project.assets.json and project.lock.json files. Note that there occasionally the file watcher generates odd events which means a packages.config file is not reloaded. Seen some events after installing a new NuGet package as follows which resulted in the packages.config file not being reloaded. OnFileChanged: test.csproj OnFileRenamed: test.csproj -> packages.config.new.20180529140342 OnFileRenamed: packages.config -> packages.config.old.20180529140342
Configuration menu - View commit details
-
Copy full SHA for 7fdb2d4 - Browse repository at this point
Copy the full SHA 7fdb2d4View commit details -
[Core] Fix packages.config file not always being reloaded
The native file watcher rename events seem problematic. On installing a NuGet package sometimes you see the following events: OnFileCreated: .#Test.csproj OnFileRenamed: .#Test.csproj -> Test.csproj OnFileChanged: test.csproj OnFileRenamed: test.csproj -> test/packages.config.new.20180529140342 OnFileRenamed: test/packages.config -> test/packages.config.old.20180529140342 The last two events do not seem correct. It seems that the wrong file names are being included in the rename event. The .csproj file is not being renamed to a temp packages.config file. To handle this a check is made to see if the original file still exists and if it does then the rename event is treated as a file change event instead.
Configuration menu - View commit details
-
Copy full SHA for b8bffba - Browse repository at this point
Copy the full SHA b8bffbaView commit details -
[ConnectedServices] Remove use of FileService notify method
This code does not seem to be called. Can rely on the file watcher for the file change event to be raised.
Configuration menu - View commit details
-
Copy full SHA for fc5fb37 - Browse repository at this point
Copy the full SHA fc5fb37View commit details
Commits on May 30, 2018
-
[Core] Rely on file watcher for file change notifications
Removed direct calls to FileService.FileNotifyChanged. This is now handled by the file watcher. Fixed two tests that were failing due to this change. The Reload SolutionTests was failing since the file changed event was no longer being generated by the Solution's SaveAsync method. This test now uses the file watcher. The SaveProject_AfterModifying file watcher test was failing since it was relying on the FileService NotifyFileChanged method being called when the project's SaveAsync method is used.
Configuration menu - View commit details
-
Copy full SHA for e860c92 - Browse repository at this point
Copy the full SHA e860c92View commit details -
[Ide] Rely on file watcher for file change events
Remove calls to FileService.NotifyFileChanged since the file watcher will generate these events. RootWorkspace's FileStatusTracker still has calls that directly use the FileService however this class is obsolete and not used anywhere. The WelcomePageSection makes a direct call to FileService's NotifyFileRemoved. This would not be generated by the file watcher since the project may have been deleted before the IDE was opened. This call is a way to have the project removed from the recently used list.
Configuration menu - View commit details
-
Copy full SHA for ed27a6f - Browse repository at this point
Copy the full SHA ed27a6fView commit details -
[DesignerSupport] Rely on file watcher for file change events
Remove calls to FileService.NotifyFileChanged. The file watcher will generate these events now.
Configuration menu - View commit details
-
Copy full SHA for 704e89c - Browse repository at this point
Copy the full SHA 704e89cView commit details -
[WebReferences] Rely on file watcher for file change events
Removed calls to FileService.NotifyFileChanged when generating the web reference files. The file change events are raised by the file watcher.
Configuration menu - View commit details
-
Copy full SHA for 2c47d11 - Browse repository at this point
Copy the full SHA 2c47d11View commit details -
[Refactoring] Rely on file watcher for file change events
Remove calls to FileService.NotifyFileChanged when refactoring changes code in files which are not open. The file watcher will generate file change events for these changes.
Configuration menu - View commit details
-
Copy full SHA for 56c0978 - Browse repository at this point
Copy the full SHA 56c0978View commit details -
[C#] Rely on file watcher for file change events
Removed use of FileService.NotifyFileChange from the CodeGenerationService. Only code that seems to call this is the GtkCore addin in the ActionGroupDisplayBinding. That code does not seem to work - it fails to create a valid syntax tree in ActionGroupDisplayBinding.CreateClass, the C# code analysis SyntaxFactory.GetConstructorInitializerThisOrBaseKeywordKind throws an ArgumentOutOfRange exception. Also the names used are empty strings.
Configuration menu - View commit details
-
Copy full SHA for 9e58661 - Browse repository at this point
Copy the full SHA 9e58661View commit details -
[Ide] Fix UI hang when many files are deleted
When there are a lot of FileService.FileRemoved events being generated the UI would hang whilst the favourited projects information was being saved in the properties file. Now a check is made to see if the favourites have changed and if not a save is not done. This fixes the UI hang if you remove a node_modules folder inside a non .NET Core project that contains thousands of files.
Configuration menu - View commit details
-
Copy full SHA for 4aa1cf0 - Browse repository at this point
Copy the full SHA 4aa1cf0View commit details
Commits on Jun 1, 2018
-
[Git] Rely on file watcher for file change events
Removed calls to the FileService for file change and remove events. Removed calls that directly reload documents in the IDE.
Configuration menu - View commit details
-
Copy full SHA for 0895d38 - Browse repository at this point
Copy the full SHA 0895d38View commit details
Commits on Jun 11, 2018
-
[Autotools] Rely on file watcher for file change events
Remove calls to FileService.NotifyFileChanged when the makefile is updated. The file watcher will fire the file change events for makefiles in the project or solution directory.
Configuration menu - View commit details
-
Copy full SHA for b417d4b - Browse repository at this point
Copy the full SHA b417d4bView commit details -
[GtkCore] Rely on file watcher for file change events
Remove calls to FileService.NotifyFileChanged. The file change events will be raised by the file watcher.
Configuration menu - View commit details
-
Copy full SHA for 12ab30c - Browse repository at this point
Copy the full SHA 12ab30cView commit details -
[Subversion] Rely on file watcher for file change events
Removed calls to FileService.NotifyFileChanged. The file change events are not generated by the file watcher.
Configuration menu - View commit details
-
Copy full SHA for 63302cf - Browse repository at this point
Copy the full SHA 63302cfView commit details
Commits on Jun 12, 2018
-
[Core] Remove file watcher debug logging
Also fix typo in file watcher comment.
Configuration menu - View commit details
-
Copy full SHA for 5cc345d - Browse repository at this point
Copy the full SHA 5cc345dView commit details
Commits on Jun 13, 2018
-
[Core] Make FileService.ThawEvents thread safe.
The ThawEvents method will now handle being called from a non-UI thread.
Configuration menu - View commit details
-
Copy full SHA for 85e867f - Browse repository at this point
Copy the full SHA 85e867fView commit details -
[Git] No need to call FileService.ThawEvents on UI thread
The FileService.ThawEvents method will now handle being called from a background thread.
Configuration menu - View commit details
-
Copy full SHA for 98a2508 - Browse repository at this point
Copy the full SHA 98a2508View commit details -
[Git] Reload files when they are reverted
Add back original code that reloaded reverted files that were open in the text editor. Without this change if the file is dirty then the file will not be reloaded and instead the text editor will show a message about the file being changed outside the IDE. Since the user explicitly asked to revert the file then the file should be reloaded automatically even if there are unsaved changes.
Configuration menu - View commit details
-
Copy full SHA for a3d9526 - Browse repository at this point
Copy the full SHA a3d9526View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6066964 - Browse repository at this point
Copy the full SHA 6066964View commit details