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