12 instantiations of WorkItem
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
SolutionCrawler\WorkCoordinatorTests.cs (3)
1324var item = new WorkItem(documentId, "C#", InvocationReasons.DocumentAdded, isLowPriority: false, analyzer: null, EmptyAsyncToken.Instance); 1345var item = new WorkItem(documentId, "C#", InvocationReasons.DocumentAdded, isLowPriority: false, analyzer: analyzer, EmptyAsyncToken.Instance); 1366var item = new WorkItem(documentId, "C#", InvocationReasons.DocumentAdded, isLowPriority: false, analyzer: analyzer, EmptyAsyncToken.Instance);
Microsoft.CodeAnalysis.Features (9)
SolutionCrawler\WorkCoordinator.cs (3)
413new WorkItem(documentId, project.Language, invocationReasons, isLowPriority, currentMember, _listener.BeginAsyncOperation("WorkItem"))); 476new WorkItem(documentId, project.Language, invocationReasons, 577list.Add(new WorkItem(document.Id, document.Project.Language, InvocationReasons.DocumentAdded, isLowPriority: false, activeMember: null, EmptyAsyncToken.Instance));
SolutionCrawler\WorkCoordinator.NormalPriorityProcessor.cs (1)
480workItem: new WorkItem(), (a, s, c) => a.NewSolutionSnapshotAsync(s, c), CancellationToken).ConfigureAwait(false);
SolutionCrawler\WorkCoordinator.SemanticChangeProcessor.cs (1)
400new WorkItem(documentId, project.Language, InvocationReasons.SemanticChanged,
SolutionCrawler\WorkCoordinator.WorkItem.cs (4)
109return new WorkItem( 122return new WorkItem( 145return new WorkItem( 155return new WorkItem(
55 references to WorkItem
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (3)
SolutionCrawler\WorkCoordinatorTests.cs (3)
1324var item = new WorkItem(documentId, "C#", InvocationReasons.DocumentAdded, isLowPriority: false, analyzer: null, EmptyAsyncToken.Instance); 1345var item = new WorkItem(documentId, "C#", InvocationReasons.DocumentAdded, isLowPriority: false, analyzer: analyzer, EmptyAsyncToken.Instance); 1366var item = new WorkItem(documentId, "C#", InvocationReasons.DocumentAdded, isLowPriority: false, analyzer: analyzer, EmptyAsyncToken.Instance);
Microsoft.CodeAnalysis.Features (52)
SolutionCrawler\WorkCoordinator.AsyncDocumentWorkItemQueue.cs (9)
19private readonly Dictionary<ProjectId, Dictionary<DocumentId, WorkItem>> _documentWorkQueue = new(); 28protected override bool TryTake_NoLock(DocumentId key, out WorkItem workInfo) 39SharedPools.BigDefault<Dictionary<DocumentId, WorkItem>>().ClearAndFree(documentMap); 50out WorkItem workItem) 95protected override bool AddOrReplace_NoLock(WorkItem item) 106documentMap.TryGetValue(key, out var existingWorkItem)) 119documentMap = SharedPools.BigDefault<Dictionary<DocumentId, WorkItem>>().AllocateAndClear(); 139foreach (var workItem in map.Values) 144SharedPools.BigDefault<Dictionary<DocumentId, WorkItem>>().ClearAndFree(map);
SolutionCrawler\WorkCoordinator.AsyncProjectWorkItemQueue.cs (6)
20private readonly Dictionary<ProjectId, WorkItem> _projectWorkQueue = new(); 39protected override bool TryTake_NoLock(ProjectId key, out WorkItem workInfo) 52out WorkItem workItem) 70protected override bool AddOrReplace_NoLock(WorkItem item) 77if (_projectWorkQueue.TryGetValue(key, out var existingWorkItem)) 93foreach (var workItem in _projectWorkQueue.Values)
SolutionCrawler\WorkCoordinator.AsyncWorkItemQueue.cs (6)
45protected abstract bool AddOrReplace_NoLock(WorkItem item); 47protected abstract bool TryTake_NoLock(TKey key, out WorkItem workInfo); 49protected abstract bool TryTakeAnyWork_NoLock(ProjectId? preferableProjectId, ProjectDependencyGraph dependencyGraph, IDiagnosticAnalyzerService? service, out WorkItem workItem); 76public bool AddOrReplace(WorkItem item) 199public bool TryTake(TKey key, out WorkItem workInfo, out CancellationToken cancellationToken) 221out WorkItem workItem,
SolutionCrawler\WorkCoordinator.cs (1)
571var list = new List<WorkItem>();
SolutionCrawler\WorkCoordinator.HighPriorityProcessor.cs (5)
80public void Enqueue(WorkItem item) 114private void EnqueueActiveFileItem(WorkItem item) 144Contract.ThrowIfFalse(GetNextWorkItem(out var workItem, out var documentCancellation)); 162private bool GetNextWorkItem(out WorkItem workItem, out CancellationToken cancellationToken) 182private async Task ProcessDocumentAsync(Solution solution, ImmutableArray<IIncrementalAnalyzer> analyzers, WorkItem workItem, CancellationToken cancellationToken)
SolutionCrawler\WorkCoordinator.IncrementalAnalyzerProcessor.cs (6)
104public void Enqueue(WorkItem item) 162TextDocument textDocument, ImmutableArray<IIncrementalAnalyzer> analyzers, WorkItem workItem, CancellationToken cancellationToken) 209async Task<bool> ProcessActiveDocumentSwitchedAsync(ImmutableArray<IIncrementalAnalyzer> analyzers, WorkItem workItem, TextDocument document, CancellationToken cancellationToken) 232WorkItem workItem, 263private async Task RunBodyAnalyzersAsync(ImmutableArray<IIncrementalAnalyzer> analyzers, WorkItem workItem, Document document, CancellationToken cancellationToken) 372internal void WaitUntilCompletion(ImmutableArray<IIncrementalAnalyzer> analyzers, List<WorkItem> items)
SolutionCrawler\WorkCoordinator.LowPriorityProcessor.cs (5)
61out var workItem, out var projectCancellation)) 95public void Enqueue(WorkItem item) 123private async Task ProcessProjectAsync(ImmutableArray<IIncrementalAnalyzer> analyzers, WorkItem workItem, CancellationToken cancellationToken) 211internal void WaitUntilCompletion(ImmutableArray<IIncrementalAnalyzer> analyzers, List<WorkItem> items) 214foreach (var item in items)
SolutionCrawler\WorkCoordinator.NormalPriorityProcessor.cs (10)
63public void Enqueue(WorkItem item) 79private void CheckHigherPriorityDocument(WorkItem item) 131out var workItem, out var documentCancellation)) 230if (!_workItemQueue.TryTake(documentId, out var workItem, out var documentCancellation)) 257private async Task ProcessDocumentAsync(ImmutableArray<IIncrementalAnalyzer> analyzers, WorkItem workItem, CancellationToken cancellationToken) 347private async Task ProcessOpenDocumentIfNeededAsync(ImmutableArray<IIncrementalAnalyzer> analyzers, WorkItem workItem, TextDocument textDocument, bool isOpen, CancellationToken cancellationToken) 372private async Task ProcessCloseDocumentIfNeededAsync(ImmutableArray<IIncrementalAnalyzer> analyzers, WorkItem workItem, TextDocument textDocument, bool isOpen, CancellationToken cancellationToken) 397private async Task ProcessReanalyzeDocumentAsync(ImmutableArray<IIncrementalAnalyzer> analyzers, WorkItem workItem, TextDocument document, CancellationToken cancellationToken) 552internal void WaitUntilCompletion(ImmutableArray<IIncrementalAnalyzer> analyzers, List<WorkItem> items) 554foreach (var item in items)
SolutionCrawler\WorkCoordinator.WorkItem.cs (4)
107public WorkItem Retry(IAsyncToken asyncToken) 114public WorkItem With( 143public WorkItem WithAsyncToken(IAsyncToken asyncToken) 150public WorkItem ToProjectWorkItem(IAsyncToken asyncToken)