-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refresh browser for all transitively referencing projects #45096
base: release/9.0.1xx
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,4 +31,28 @@ public static bool IsNetCoreApp(this ProjectGraphNode projectNode, Version minVe | |
|
||
public static IEnumerable<string> GetCapabilities(this ProjectGraphNode projectNode) | ||
=> projectNode.ProjectInstance.GetItems("ProjectCapability").Select(item => item.EvaluatedInclude); | ||
|
||
public static IEnumerable<ProjectGraphNode> GetTransitivelyReferencingProjects(this IEnumerable<ProjectGraphNode> projects) | ||
{ | ||
var visited = new HashSet<ProjectGraphNode>(); | ||
var queue = new Queue<ProjectGraphNode>(); | ||
foreach (var project in projects) | ||
{ | ||
queue.Enqueue(project); | ||
} | ||
|
||
while (queue.Count > 0) | ||
{ | ||
var project = queue.Dequeue(); | ||
if (visited.Add(project)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not familiar with ProjectGraphNode, but is it guaranteed that either:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be odd if new instances of ProjectGraphNode were created as we traverse the graph. |
||
{ | ||
foreach (var referencingProject in project.ReferencingProjects) | ||
{ | ||
queue.Enqueue(referencingProject); | ||
} | ||
} | ||
} | ||
|
||
return visited; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should strings be localized?