-
Notifications
You must be signed in to change notification settings - Fork 397
Consume IFileWatcherService from CPS #9662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/Microsoft.VisualStudio.ProjectSystem.Managed/IO/SimpleFileWatcher.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.VisualStudio.ProjectSystem.Managed/IO/SimpleFileWatcher.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.VisualStudio.ProjectSystem.Managed/FileWatch/IFileWatcherService.cs
Outdated
Show resolved
Hide resolved
f48f3eb
to
f1711dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new public interface IFileWatcherService and integrates it into LaunchSettingsProvider, enabling support for file watching via MEF. It updates both production and test code to stop using the legacy SimpleFileWatcher and instead use the injected IFileWatcherService.
- Updated tests to pass a mock IFileWatcherService and remove direct use of SimpleFileWatcher.
- Refactored LaunchSettingsProvider to implement IFileWatcherServiceClient, set up file watchers asynchronously, and handle file change notifications.
- Removed the legacy CleanupFileWatcher and related code to streamline file watcher management.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
tests/Microsoft.VisualStudio.ProjectSystem.Managed.UnitTests/ProjectSystem/Debug/LaunchSettingsProviderTests.cs | Updated lambda formatting and constructor parameters to use the mock IFileWatcherService instead of creating a real file watcher. |
src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Debug/LaunchSettingsProvider.cs | Integrated IFileWatcherService and refactored file watcher setup/disposal with asynchronous registration and unregistration. |
src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Debug/LaunchSettingsProvider.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Debug/LaunchSettingsProvider.cs
Show resolved
Hide resolved
src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Debug/LaunchSettingsProvider.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Debug/LaunchSettingsProvider.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Thanks for banning the API too. I think that's a great improvement for future.
Left a few comments on minor things for you to take or leave at your discretion.
src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Debug/LaunchSettingsProvider.cs
Show resolved
Hide resolved
src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Debug/LaunchSettingsProvider.cs
Show resolved
Hide resolved
src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Debug/LaunchSettingsProvider.cs
Show resolved
Hide resolved
src/Microsoft.VisualStudio.ProjectSystem.Managed/ProjectSystem/Debug/LaunchSettingsProvider.cs
Outdated
Show resolved
Hide resolved
...ualStudio.ProjectSystem.Managed.UnitTests/ProjectSystem/Debug/LaunchSettingsProviderTests.cs
Show resolved
Hide resolved
I think you want to think about these scenarios:
|
…/Debug/LaunchSettingsProvider.cs Co-authored-by: Drew Noakes <[email protected]>
I test the following scenarios
It seems that in both
The cause for the second issue is because we are not watching the folder change/renaming event, so @drewnoakes @davkean how to listen for the changes of appdesigner properties folder name |
Given rename doesn't work on main, it's a nice-to-have here. Feels like an edge case. Great if we can make it work, but we don't have to hold this up on it. Maybe file it as an issue. A scenario that I do think we should check is the outright deletion and recreation of the |
I created a tracking issue here: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2496401/ and assign myself to look at. Maybe the exact
Seems that there's an issue to track that already: #2316 |
What does this PR do
This PR consumes the
IFileWatcherService
from CPS inLaunchSettingsProvider
class so we can avoid create another system file watcher in project conerelevant issues
Microsoft Reviewers: Open in CodeFlow