Skip to content

Commit

Permalink
Use IAsyncServiceProvider for simplicity
Browse files Browse the repository at this point in the history
  • Loading branch information
DustinCampbell committed Mar 26, 2024
1 parent 956e9db commit 7a20296
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal class VisualStudioFileChangeTrackerFactory : IFileChangeTrackerFactory

[ImportingConstructor]
public VisualStudioFileChangeTrackerFactory(
SVsServiceProvider serviceProvider,
[Import(typeof(SAsyncServiceProvider))] IAsyncServiceProvider serviceProvider,
JoinableTaskContext joinableTaskContext,
ProjectSnapshotManagerDispatcher dispatcher,
IErrorReporter errorReporter)
Expand All @@ -30,12 +30,7 @@ public VisualStudioFileChangeTrackerFactory(
_errorReporter = errorReporter;

var jtf = _joinableTaskContext.Factory;
_getFileChangeServiceTask = jtf.RunAsync(async () =>
{
await jtf.SwitchToMainThreadAsync();

return (IVsAsyncFileChangeEx)serviceProvider.GetService(typeof(SVsFileChangeEx));
});
_getFileChangeServiceTask = jtf.RunAsync(serviceProvider.GetServiceAsync<SVsFileChangeEx, IVsAsyncFileChangeEx>);
}

public IFileChangeTracker Create(string filePath)
Expand Down

0 comments on commit 7a20296

Please # to comment.