Skip to content

Commit

Permalink
fix: break infinite recursion in renderTreeNode
Browse files Browse the repository at this point in the history
* can be reproduced with
  libraryDependencies += "io.grpc" % "grpc-core" % "1.58.0"
* normal dependencyTree looks good, so I don't know what is wrong with the
  grpc dependency or if there is something else missing in this traversal?
  • Loading branch information
patriknw committed Oct 16, 2023
1 parent fa6dc01 commit 050ea29
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ project/plugins/project/
.history
.cache
.lib/
.bsp

### Scala template
*.class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ class DependenciesDirective(showLicenses: Boolean)(projectIdToDependencies: Stri
p.print("</pre></dd>").println()
}

private def renderTreeNode(p: Printer, graph: ModuleGraph, n: Module): Unit =
if (n.evictedByVersion.isEmpty) {
private def renderTreeNode(p: Printer, graph: ModuleGraph, n: Module): Unit = {
// not useful with too many indents and that may be infinite recursion
if (p.indent < 100 && n.evictedByVersion.isEmpty) {
val moduleId = n.id
val name = moduleId.name
p.println()
Expand All @@ -103,6 +104,7 @@ class DependenciesDirective(showLicenses: Boolean)(projectIdToDependencies: Stri
p.indent(-4)
}
}
}

private def children(graph: ModuleGraph, module: Module) = graph.dependencyMap(module.id)

Expand Down

0 comments on commit 050ea29

Please sign in to comment.