6 instantiations of WatcherOperation
Microsoft.VisualStudio.LanguageServices (6)
ProjectSystem\FileChangeWatcher.cs (6)
250public static WatcherOperation Empty => new(Kind.None);
253=> new(Kind.WatchDirectory, directory, filter, sink, cookies);
256=> new(Kind.WatchFile, path, fileChangeFlags, sink, token);
259=> new(Kind.UnwatchDirectories, cookies);
262=> new(Kind.UnwatchFiles, tokens);
265=> new(Kind.UnwatchFile, token);
20 references to WatcherOperation
Microsoft.VisualStudio.LanguageServices (20)
ProjectSystem\FileChangeWatcher.cs (20)
39private readonly AsyncBatchingWorkQueue<WatcherOperation> _taskQueue;
49_taskQueue = new AsyncBatchingWorkQueue<WatcherOperation>(
56private async ValueTask ProcessBatchAsync(ImmutableSegmentedList<WatcherOperation> workItems, CancellationToken cancellationToken)
60var prior = WatcherOperation.Empty;
63if (prior.TryCombineWith(workItems[i], out var combined))
250public static WatcherOperation Empty => new(Kind.None);
252public static WatcherOperation WatchDirectory(string directory, string? filter, IVsFreeThreadedFileChangeEvents2 sink, List<uint> cookies)
255public static WatcherOperation WatchFile(string path, _VSFILECHANGEFLAGS fileChangeFlags, IVsFreeThreadedFileChangeEvents2 sink, Context.RegularWatchedFile token)
258public static WatcherOperation UnwatchDirectories(List<uint> cookies)
261public static WatcherOperation UnwatchFiles(IEnumerable<Context.RegularWatchedFile> tokens)
264public static WatcherOperation UnwatchFile(Context.RegularWatchedFile token)
268/// Attempts to combine the current <see cref="WatcherOperation"/> with the next operation in sequence. When
278public bool TryCombineWith(in WatcherOperation other, out WatcherOperation combined)
397watchedDirectory => WatcherOperation.WatchDirectory(watchedDirectory.Path, watchedDirectory.ExtensionFilter, this, _directoryWatchCookies)));
413_fileChangeWatcher._taskQueue.AddWork(WatcherOperation.UnwatchDirectories(_directoryWatchCookies));
414_fileChangeWatcher._taskQueue.AddWork(WatcherOperation.UnwatchFiles(_activeFileWatchingTokens));
441_fileChangeWatcher._taskQueue.AddWork(WatcherOperation.WatchFile(filePath, _VSFILECHANGEFLAGS.VSFILECHG_Size | _VSFILECHANGEFLAGS.VSFILECHG_Time, this, token));
453_fileChangeWatcher._taskQueue.AddWork(WatcherOperation.UnwatchFile(watchedFile));