From f101bcd3d0f5f76651bb1be191241eadcc9a52d1 Mon Sep 17 00:00:00 2001 From: Grzegorz Kossakowski Date: Tue, 22 Jan 2013 17:53:38 -0800 Subject: [PATCH] Show some of inherited members of a structure in `ShowAPI.scala` Showing inherited members of a structure was disabled so we would not run into cycles. To best of my knowledge, we can run into cycles only if inherited member is `ClassLike`. We filter out those and let anything else to be shown. --- compile/api/src/main/scala/xsbt/api/ShowAPI.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/compile/api/src/main/scala/xsbt/api/ShowAPI.scala b/compile/api/src/main/scala/xsbt/api/ShowAPI.scala index ab7e41fb7..0b23d45e3 100644 --- a/compile/api/src/main/scala/xsbt/api/ShowAPI.scala +++ b/compile/api/src/main/scala/xsbt/api/ShowAPI.scala @@ -210,9 +210,11 @@ trait ShowTypes { implicit def showStructure(implicit t: Show[Type], d: Show[Definition]): Show[Structure] = new Show[Structure] { - def show(s: Structure) = - // don't show inherited to avoid dealing with cycles - concat(s.parents, t, " with ") + "\n{\n" + lines(s.declared, d) + "\n}" + def show(s: Structure) = { + // don't show inherited class like definitions to avoid dealing with cycles + val safeInherited = s.inherited.filterNot(_.isInstanceOf[ClassLike]) + concat(s.parents, t, " with ") + "\n{\n" + lines(safeInherited ++ s.declared, d) + "\n}" + } } implicit def showAnnotated(implicit as: Show[Annotation], t: Show[Type]): Show[Annotated] = new Show[Annotated] { def show(a: Annotated) = spaced(a.annotations, as) + " " + t.show(a.baseType) }