Skip to content

Commit abd7654

Browse files
committed
This changes removes the ProjectDependencyService and replaces the Solution's itnernal transitive dependency tracking with the ProjectDependencyGraph. After the change removing async projects from solutions, the service was no longer necessary, as dependency graphs (mostly on demand) can be computed and reused for most solution branching. The solution's internal transitive dependency tracking then became redundant. (changeset 1210210)
1 parent 30c925b commit abd7654

9 files changed

Lines changed: 318 additions & 906 deletions

File tree

Src/Workspaces/Core/FindSymbols/FindReferences/FindReferencesSearchEngine.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ internal partial class FindReferencesSearchEngine
2121
private readonly ImmutableList<IReferenceFinder> finders;
2222
private readonly IFindReferencesProgress progress;
2323
private readonly CancellationToken cancellationToken;
24-
private readonly AsyncLazy<ProjectDependencyGraph> lazyDependencyGraph;
24+
private readonly ProjectDependencyGraph dependencyGraph;
2525

2626
/// <summary>
2727
/// Mapping from a document to the list of reference locations found in it. Kept around so
@@ -49,7 +49,7 @@ public FindReferencesSearchEngine(
4949
this.finders = finders;
5050
this.progress = progress;
5151
this.cancellationToken = cancellationToken;
52-
this.lazyDependencyGraph = new AsyncLazy<ProjectDependencyGraph>(c => solution.GetProjectDependencyGraphAsync(c), cacheResult: true);
52+
this.dependencyGraph = solution.GetProjectDependencyGraph();
5353
}
5454

5555
public async Task<IEnumerable<ReferencedSymbol>> FindReferencesAsync(ISymbol symbol)
@@ -89,8 +89,7 @@ private async Task ProcessAsync(
8989
// Get the connected components of the dependency graph and process each individually.
9090
// That way once a component is done we can throw away all the memory associated with
9191
// it.
92-
var graph = await this.lazyDependencyGraph.GetValueAsync(cancellationToken).ConfigureAwait(false);
93-
var connectedProjects = graph.GetConnectedProjects(cancellationToken);
92+
var connectedProjects = this.dependencyGraph.GetDependencySets(cancellationToken);
9493
var projectMap = CreateProjectMap(documentMap);
9594

9695
foreach (var projectSet in connectedProjects)

Src/Workspaces/Core/Rename/ConflictEngine/ConflictResolver.Session.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ private async Task FindDocumentsAndPossibleNameConflicts()
553553
var symbol = renameLocationSet.Symbol;
554554
var newSolution = renameLocationSet.Solution;
555555

556-
var dependencyGraph = await newSolution.GetProjectDependencyGraphAsync(cancellationToken).ConfigureAwait(false);
556+
var dependencyGraph = newSolution.GetProjectDependencyGraph();
557557
this.topologicallySortedProjects = dependencyGraph.GetTopologicallySortedProjects(cancellationToken).ToList();
558558

559559
if (symbol.Kind == SymbolKind.Local || symbol.Kind == SymbolKind.Label || symbol.Kind == SymbolKind.RangeVariable)

Src/Workspaces/Core/Workspace/Solution/ProjectDependencyGraph.cs

Lines changed: 230 additions & 348 deletions
Large diffs are not rendered by default.

Src/Workspaces/Core/Workspace/Solution/ProjectDependencyService.cs

Lines changed: 0 additions & 235 deletions
This file was deleted.

0 commit comments

Comments
 (0)