Skip to content

Commit

Permalink
Adopt new Dendrology API
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Dec 7, 2023
1 parent 8a07824 commit 4336676
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/core/report.scala
Original file line number Diff line number Diff line change
Expand Up @@ -297,18 +297,13 @@ class TestReport(using Environment):

val maxHits = data.map(_.branches).maxOption

def line(tiles: List[TreeTile], surface: Surface): (Output, Juncture) =
import treeStyles.default
import surface.juncture.*
given TreeStyle[(Output, Juncture)] = (tiles, row) =>
val description = if row(1).treeName == t"DefDef" then row(1).method.display else e"${row(1).shortCode}"

val description: Output =
if surface.juncture.treeName == t"DefDef" then surface.juncture.method.display
else e"$shortCode"

e"${tiles.map(_.text).join}$description" -> surface.juncture
e"${tiles.map(treeStyles.default.text(_)).join}$description" -> row(1)

def render(junctures: List[Surface]): LazyList[(Output, Juncture)] =
drawTree[Surface, (Output, Juncture)](_.children, line)(junctures)
drawTree[Surface, (Output, Juncture)](_.children, surface => (e"", surface.juncture))(junctures)

import colors.*

Expand Down

0 comments on commit 4336676

Please sign in to comment.