From e8b07a33e085136a70b68f5172153c8e557c89f9 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 9 Nov 2015 15:25:34 +0100 Subject: Better diagnosis from completions printer Track starts and ends of completions using indentation. --- src/dotty/tools/dotc/core/SymDenotations.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala') diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index a74cf0000..feb0c22df 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -163,6 +163,11 @@ object SymDenotations { } private def completeFrom(completer: LazyType)(implicit ctx: Context): Unit = { + if (completions ne noPrinter) { + completions.println(i"${" " * indent}completing ${if (isType) "type" else "val"} $name") + indent += 1 + } + indent += 1 if (myFlags is Touched) throw CyclicReference(this) myFlags |= Touched @@ -173,6 +178,11 @@ object SymDenotations { completions.println(s"error while completing ${this.debugString}") throw ex } + finally + if (completions ne noPrinter) { + indent -= 1 + completions.println(i"${" " * indent}completed $name in $owner") + } // completions.println(s"completed ${this.debugString}") } @@ -1872,4 +1882,6 @@ object SymDenotations { } private val AccessorOrLabel = Accessor | Label + + private var indent = 0 // for completions printing } -- cgit v1.2.3