Skip to content

Commit

Permalink
Utilize IVsAsyncFileChangeEx2 (#70936)
Browse files Browse the repository at this point in the history
This interface allows a more efficient mechanism by allowing for batch advising to file change events.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1870752
  • Loading branch information
ToddGrun authored Dec 6, 2023
1 parent d7f5e61 commit 92a930f
Show file tree
Hide file tree
Showing 5 changed files with 155 additions and 163 deletions.
4 changes: 2 additions & 2 deletions src/VisualStudio/Core/Def/ProjectSystem/FileChangeTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.ErrorReporting;
using IVsAsyncFileChangeEx = Microsoft.VisualStudio.Shell.IVsAsyncFileChangeEx;
using IVsAsyncFileChangeEx2 = Microsoft.VisualStudio.Shell.IVsAsyncFileChangeEx2;
using Microsoft.VisualStudio.Shell.Interop;
using Roslyn.Utilities;

Expand Down Expand Up @@ -112,7 +112,7 @@ public Task StartFileChangeListeningAsync()
try
{
// TODO: Should we pass in cancellationToken here insead of CancellationToken.None?
return await ((IVsAsyncFileChangeEx)_fileChangeService).AdviseFileChangeAsync(_filePath, _fileChangeFlags, this, CancellationToken.None).ConfigureAwait(false);
return await ((IVsAsyncFileChangeEx2)_fileChangeService).AdviseFileChangeAsync(_filePath, _fileChangeFlags, this, CancellationToken.None).ConfigureAwait(false);
}
catch (Exception e) when (ReportException(e))
{
Expand Down
Loading

0 comments on commit 92a930f

Please sign in to comment.