-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
I have the following image generated:

This is the code I am using:
implicit def `ArrayDeque RefTree`: ToRefTree[mutable.ArrayDeque[Char]] = ToRefTree {ds =>
val array = ds.privateField[Array[AnyRef]]("array").map(c => Option(c).getOrElse('␀').asInstanceOf[Char])
val start = ds.privateField[Int]("start")
val end = ds.privateField[Int]("end")
val arrayRef = {
val arrayFields = array.zipWithIndex map { case (a, i) =>
val name = i match {
case `start` if start == end => s"start=end=$i"
case `start` => s"start=$i"
case `end` => s"end=$i"
case _ => i.toString
}
a.refTree.withHighlight(i == start || i == end).toField.withName(name)
}
RefTree.Ref(array, arrayFields).rename(s"char[${array.length}]")
}
RefTree.Ref(ds, Seq(
start.refTree.withHighlight(true).toField.withName("start"),
end.refTree.withHighlight(true).toField.withName("end"),
arrayRef.toField.withName("array")
) ++ ds.toArray.zipWithIndex.map({case (a, i) => a.refTree.toField.withName(i.toString)}))
}But, it would be nice to have start and end have arrows into the array. Is it possible?
Metadata
Metadata
Assignees
Labels
No labels