@@ -17,7 +17,7 @@ import util.SimpleMap
17
17
import util .Stats
18
18
import java .util .WeakHashMap
19
19
import config .Config
20
- import config .Printers .{completions , incremental , noPrinter }
20
+ import config .Printers .{incremental , noPrinter }
21
21
22
22
trait SymDenotations { this : Context =>
23
23
import SymDenotations ._
@@ -214,28 +214,31 @@ object SymDenotations {
214
214
case _ => Some (myInfo)
215
215
}
216
216
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" )
220
220
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 {
234
233
indent -= 1
235
- completions. println(i " ${" " * indent}completed $name in $owner" )
234
+ println(i " ${" " * indent}completed $name in $owner" )
236
235
}
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
+ }
239
242
240
243
protected [dotc] def info_= (tp : Type ) = {
241
244
/* // DEBUG
@@ -797,7 +800,10 @@ object SymDenotations {
797
800
*/
798
801
/** The class implementing this module, NoSymbol if not applicable. */
799
802
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
+ }
801
807
if (this is ModuleVal )
802
808
myInfo match {
803
809
case info : TypeRef => info.symbol
0 commit comments