Skip to content

Commit

Permalink
fix: add missing nodes after full scan
Browse files Browse the repository at this point in the history
  • Loading branch information
NikiforovAll committed Aug 13, 2024
1 parent bfff95a commit 75990a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
19 changes: 8 additions & 11 deletions src/Dependify.Core/SolutionRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ public class SolutionRegistry

public IList<SolutionReferenceNode> Solutions { get; private set; } = [];
public IList<Node> Nodes { get; private set; }

public IReadOnlyCollection<Node> ProjectsAndSolutions =>
this.GetFullGraph()
.Nodes.Where(n =>
(n.Type == NodeConstants.Solution || n.Type == NodeConstants.Project)
&& n is not SolutionReferenceNode { IsEmpty: true }
)
.ToList();
public bool IsLoaded { get; private set; }

public SolutionRegistry(FileProviderProjectLocator projectLocator, MsBuildService buildService)

Check warning on line 31 in src/Dependify.Core/SolutionRegistry.cs

View workflow job for this annotation

GitHub Actions / Build-ubuntu-latest

Non-nullable property 'OnProgress' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 31 in src/Dependify.Core/SolutionRegistry.cs

View workflow job for this annotation

GitHub Actions / Build-ubuntu-latest

Non-nullable property 'Nodes' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 31 in src/Dependify.Core/SolutionRegistry.cs

View workflow job for this annotation

GitHub Actions / Build-ubuntu-latest

Non-nullable property 'OnProgress' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 31 in src/Dependify.Core/SolutionRegistry.cs

View workflow job for this annotation

GitHub Actions / Build-ubuntu-latest

Non-nullable property 'Nodes' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 31 in src/Dependify.Core/SolutionRegistry.cs

View workflow job for this annotation

GitHub Actions / Build-windows-latest

Non-nullable property 'OnProgress' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 31 in src/Dependify.Core/SolutionRegistry.cs

View workflow job for this annotation

GitHub Actions / Build-windows-latest

Non-nullable property 'Nodes' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 31 in src/Dependify.Core/SolutionRegistry.cs

View workflow job for this annotation

GitHub Actions / Build-windows-latest

Non-nullable property 'OnProgress' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 31 in src/Dependify.Core/SolutionRegistry.cs

View workflow job for this annotation

GitHub Actions / Build-windows-latest

Non-nullable property 'Nodes' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
Expand Down Expand Up @@ -107,21 +115,10 @@ public DependencyGraph GetFullGraph()

foreach (var (solution, graph) in this.solutionGraphs)
{
var solutionNode = new SolutionReferenceNode(solution.Path);

builder.WithNode(solutionNode);

foreach (var node in graph.Nodes)
{
if (node.Type == NodeConstants.Solution)
{
continue;
}

builder.WithNode(node);

builder.WithEdge(new Edge(solutionNode, node));

foreach (var edgeNode in graph.FindDescendants(node))
{
builder.WithEdge(new Edge(node, edgeNode));
Expand Down
2 changes: 1 addition & 1 deletion src/Web/Components/Pages/DependencyExplorer.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)

private void FullLoadRegistry()
{
this.NodeIds = this.SolutionRegistry.Nodes.Select(n => n.Id).ToHashSet();
this.NodeIds = this.SolutionRegistry.ProjectsAndSolutions.Select(n => n.Id).ToHashSet();
}

private async Task ToggleIncludeAsync(string nodeId)
Expand Down

0 comments on commit 75990a6

Please sign in to comment.