@@ -91,7 +91,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
91
91
92
92
override def toTextRef (tp : SingletonType ): Text = controlled {
93
93
tp match {
94
- case tp : ThisType =>
94
+ case tp : ThisType if ! printDebug =>
95
95
if (tp.cls.isAnonymousClass) return keywordStr(" this" )
96
96
if (tp.cls is ModuleClass ) return fullNameString(tp.cls.sourceModule)
97
97
case _ =>
@@ -101,7 +101,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
101
101
102
102
override def toTextPrefix (tp : Type ): Text = controlled {
103
103
def isOmittable (sym : Symbol ) =
104
- if (ctx.settings.verbose.value ) false
104
+ if (printDebug ) false
105
105
else if (homogenizedView) isEmptyPrefix(sym) // drop <root> and anonymous classes, but not scala, Predef.
106
106
else isOmittablePrefix(sym)
107
107
tp match {
@@ -182,7 +182,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
182
182
val cls = tycon.typeSymbol
183
183
if (tycon.isRepeatedParam) return toTextLocal(args.head) ~ " *"
184
184
if (defn.isFunctionClass(cls)) return toTextFunction(args, cls.name.isImplicitFunction, cls.name.isErasedFunction)
185
- if (tp.tupleArity >= 2 && ! ctx.settings. YprintDebug .value ) return toTextTuple(tp.tupleElementTypes)
185
+ if (tp.tupleArity >= 2 && ! printDebug ) return toTextTuple(tp.tupleElementTypes)
186
186
if (isInfixType(tp)) {
187
187
val l :: r :: Nil = args
188
188
val opName = tyconName(tycon)
@@ -197,7 +197,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
197
197
case OrType (tp1, tp2) =>
198
198
return toTextInfixType(tpnme.raw.BAR , tp1, tp2) { toText(tpnme.raw.BAR ) }
199
199
200
- case EtaExpansion (tycon) if ! ctx.settings. YprintDebug .value =>
200
+ case EtaExpansion (tycon) if ! printDebug =>
201
201
return toText(tycon)
202
202
case tp : RefinedType if defn.isFunctionType(tp) =>
203
203
return toTextDependentFunction(tp.refinedInfo.asInstanceOf [MethodType ])
@@ -237,7 +237,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
237
237
}
238
238
return " [applied to " ~ (Str (" given " ) provided tp.isContextualMethod) ~ (Str (" erased " ) provided tp.isErasedMethod) ~ " (" ~ argsText ~ " ) returning " ~ toText(resultType) ~ " ]"
239
239
case IgnoredProto (ignored) =>
240
- return " ?" ~ ((" (ignored: " ~ toText(ignored) ~ " )" ) provided ctx.settings.verbose.value )
240
+ return " ?" ~ ((" (ignored: " ~ toText(ignored) ~ " )" ) provided printDebug )
241
241
case tp @ PolyProto (targs, resType) =>
242
242
return " [applied to [" ~ toTextGlobal(targs, " , " ) ~ " ] returning " ~ toText(resType)
243
243
case _ =>
@@ -255,7 +255,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
255
255
(" {" ~ toText(trees, " \n " ) ~ " }" ).close
256
256
257
257
protected def typeApplyText [T >: Untyped ](tree : TypeApply [T ]): Text = {
258
- val isQuote = ! ctx.settings. YprintDebug .value && tree.fun.hasType && tree.fun.symbol == defn.InternalQuoted_typeQuote
258
+ val isQuote = ! printDebug && tree.fun.hasType && tree.fun.symbol == defn.InternalQuoted_typeQuote
259
259
val (open, close) = if (isQuote) (keywordStr(" '[" ), keywordStr(" ]" )) else (" [" , " ]" )
260
260
val funText = toTextLocal(tree.fun).provided(! isQuote)
261
261
tree.fun match {
@@ -337,9 +337,9 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
337
337
if (name.isTypeName) typeText(txt)
338
338
else txt
339
339
case tree @ Select (qual, name) =>
340
- if (! ctx.settings. YprintDebug .value && tree.hasType && tree.symbol == defn.QuotedType_splice ) typeText(" ${" ) ~ toTextLocal(qual) ~ typeText(" }" )
340
+ if (! printDebug && tree.hasType && tree.symbol == defn.QuotedType_splice ) typeText(" ${" ) ~ toTextLocal(qual) ~ typeText(" }" )
341
341
else if (qual.isType) toTextLocal(qual) ~ " #" ~ typeText(toText(name))
342
- else toTextLocal(qual) ~ (" ." ~ nameIdText(tree) provided (name != nme.CONSTRUCTOR || ctx.settings. YprintDebug .value ))
342
+ else toTextLocal(qual) ~ (" ." ~ nameIdText(tree) provided (name != nme.CONSTRUCTOR || printDebug ))
343
343
case tree : This =>
344
344
optDotPrefix(tree) ~ keywordStr(" this" ) ~ idText(tree)
345
345
case Super (qual : This , mix) =>
@@ -349,9 +349,9 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
349
349
changePrec (GlobalPrec ) {
350
350
keywordStr(" throw " ) ~ toText(args.head)
351
351
}
352
- else if (! ctx.settings. YprintDebug .value && fun.hasType && fun.symbol == defn.InternalQuoted_exprQuote )
352
+ else if (! printDebug && fun.hasType && fun.symbol == defn.InternalQuoted_exprQuote )
353
353
keywordStr(" '{" ) ~ toTextGlobal(args, " , " ) ~ keywordStr(" }" )
354
- else if (! ctx.settings. YprintDebug .value && fun.hasType && fun.symbol == defn.InternalQuoted_exprSplice )
354
+ else if (! printDebug && fun.hasType && fun.symbol == defn.InternalQuoted_exprSplice )
355
355
keywordStr(" ${" ) ~ toTextGlobal(args, " , " ) ~ keywordStr(" }" )
356
356
else if (app.isGivenApply && ! homogenizedView)
357
357
changePrec(InfixPrec ) {
@@ -519,7 +519,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
519
519
case EmptyTree =>
520
520
" <empty>"
521
521
case TypedSplice (t) =>
522
- if (ctx.settings. YprintDebug .value ) " [" ~ toText(t) ~ " ]#TS#"
522
+ if (printDebug ) " [" ~ toText(t) ~ " ]#TS#"
523
523
else toText(t)
524
524
case tree @ ModuleDef (name, impl) =>
525
525
withEnclosingDef(tree) {
@@ -603,7 +603,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
603
603
case Splice (tree) =>
604
604
keywordStr(" ${" ) ~ toTextGlobal(dropBlock(tree)) ~ keywordStr(" }" )
605
605
case tree : Applications .IntegratedTypeArgs =>
606
- toText(tree.app) ~ Str (" (with integrated type args)" ).provided(ctx.settings. YprintDebug .value )
606
+ toText(tree.app) ~ Str (" (with integrated type args)" ).provided(printDebug )
607
607
case Thicket (trees) =>
608
608
" Thicket {" ~~ toTextGlobal(trees, " \n " ) ~~ " }"
609
609
case _ =>
@@ -785,8 +785,9 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
785
785
786
786
protected def templateText (tree : TypeDef , impl : Template ): Text = {
787
787
val decl = modText(tree.mods, tree.symbol, keywordStr(if ((tree).mods is Trait ) " trait" else " class" ), isType = true )
788
- decl ~~ typeText(nameIdText(tree)) ~ withEnclosingDef(tree) { toTextTemplate(impl) } ~
789
- (if (tree.hasType && ctx.settings.verbose.value) i " [decls = ${tree.symbol.info.decls}] " else " " )
788
+ ( decl ~~ typeText(nameIdText(tree)) ~ withEnclosingDef(tree) { toTextTemplate(impl) }
789
+ // ~ (if (tree.hasType && printDebug) i"[decls = ${tree.symbol.info.decls}]" else "") // uncomment to enable
790
+ )
790
791
}
791
792
792
793
protected def toTextPackageId [T >: Untyped ](pid : Tree [T ]): Text =
0 commit comments