@@ -17,7 +17,7 @@ import util.SimpleIdentityMap
1717import util .Stats
1818import java .util .WeakHashMap
1919import config .Config
20- import config .Printers .{completions , incremental , noPrinter }
20+ import config .Printers .{incremental , noPrinter }
2121
2222trait SymDenotations { this : Context =>
2323 import SymDenotations ._
@@ -214,28 +214,31 @@ object SymDenotations {
214214 case _ => Some (myInfo)
215215 }
216216
217- private def completeFrom (completer : LazyType )(implicit ctx : Context ): Unit = {
218- if (completions ne noPrinter ) {
219- completions. println(i " ${" " * indent}completing ${if (isType) " type" else " val" } $name" )
217+ private def completeFrom (completer : LazyType )(implicit ctx : Context ): Unit =
218+ if (Config .showCompletions ) {
219+ println(i " ${" " * indent}completing ${if (isType) " type" else " val" } $name" )
220220 indent += 1
221- }
222- if (myFlags is Touched ) throw CyclicReference (this )
223- myFlags |= Touched
224-
225- // completions.println(s"completing ${this.debugString}")
226- try completer.complete(this )(ctx.withPhase(validFor.firstPhaseId))
227- catch {
228- case ex : CyclicReference =>
229- completions.println(s " error while completing ${this .debugString}" )
230- throw ex
231- }
232- finally
233- if (completions ne noPrinter) {
221+
222+ if (myFlags is Touched ) throw CyclicReference (this )
223+ myFlags |= Touched
224+
225+ // completions.println(s"completing ${this.debugString}")
226+ try completer.complete(this )(ctx.withPhase(validFor.firstPhaseId))
227+ catch {
228+ case ex : CyclicReference =>
229+ println(s " error while completing ${this .debugString}" )
230+ throw ex
231+ }
232+ finally {
234233 indent -= 1
235- completions. println(i " ${" " * indent}completed $name in $owner" )
234+ println(i " ${" " * indent}completed $name in $owner" )
236235 }
237- // completions.println(s"completed ${this.debugString}")
238- }
236+ }
237+ else {
238+ if (myFlags is Touched ) throw CyclicReference (this )
239+ myFlags |= Touched
240+ completer.complete(this )(ctx.withPhase(validFor.firstPhaseId))
241+ }
239242
240243 protected [dotc] def info_= (tp : Type ) = {
241244 /* // DEBUG
@@ -797,7 +800,10 @@ object SymDenotations {
797800 */
798801 /** The class implementing this module, NoSymbol if not applicable. */
799802 final def moduleClass (implicit ctx : Context ): Symbol = {
800- def notFound = { completions.println(s " missing module class for $name: $myInfo" ); NoSymbol }
803+ def notFound = {
804+ if (Config .showCompletions) println(s " missing module class for $name: $myInfo" )
805+ NoSymbol
806+ }
801807 if (this is ModuleVal )
802808 myInfo match {
803809 case info : TypeRef => info.symbol
0 commit comments