diff options
author | Martin Odersky <odersky@gmail.com> | 2015-11-09 15:25:34 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-11-09 15:45:41 +0100 |
commit | e8b07a33e085136a70b68f5172153c8e557c89f9 (patch) | |
tree | 4423de22425f9efdc690b81dbc5559e51e34d4ca /src/dotty/tools | |
parent | 9fe9865d462a646ca122f9a00bd3ad5595905e90 (diff) | |
download | dotty-e8b07a33e085136a70b68f5172153c8e557c89f9.tar.gz dotty-e8b07a33e085136a70b68f5172153c8e557c89f9.tar.bz2 dotty-e8b07a33e085136a70b68f5172153c8e557c89f9.zip |
Better diagnosis from completions printer
Track starts and ends of completions using indentation.
Diffstat (limited to 'src/dotty/tools')
-rw-r--r-- | src/dotty/tools/dotc/config/Printers.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/config/Printers.scala b/src/dotty/tools/dotc/config/Printers.scala index b44a1d2f6..8b9cc45c4 100644 --- a/src/dotty/tools/dotc/config/Printers.scala +++ b/src/dotty/tools/dotc/config/Printers.scala @@ -22,13 +22,13 @@ object Printers { val implicitsDetailed: Printer = noPrinter val subtyping: Printer = noPrinter val unapp: Printer = noPrinter - val completions = noPrinter val gadts = noPrinter val hk = noPrinter val variances = noPrinter val incremental = noPrinter val config = noPrinter val transforms = noPrinter + val completions = noPrinter val cyclicErrors = noPrinter val pickling = noPrinter } 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 } |