@@ -91,7 +91,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
9191
9292 override def toTextRef (tp : SingletonType ): Text = controlled {
9393 tp match {
94- case tp : ThisType =>
94+ case tp : ThisType if ! printDebug =>
9595 if (tp.cls.isAnonymousClass) return keywordStr(" this" )
9696 if (tp.cls is ModuleClass ) return fullNameString(tp.cls.sourceModule)
9797 case _ =>
@@ -101,7 +101,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
101101
102102 override def toTextPrefix (tp : Type ): Text = controlled {
103103 def isOmittable (sym : Symbol ) =
104- if (ctx.settings.verbose.value ) false
104+ if (printDebug ) false
105105 else if (homogenizedView) isEmptyPrefix(sym) // drop <root> and anonymous classes, but not scala, Predef.
106106 else isOmittablePrefix(sym)
107107 tp match {
@@ -182,7 +182,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
182182 val cls = tycon.typeSymbol
183183 if (tycon.isRepeatedParam) return toTextLocal(args.head) ~ " *"
184184 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)
186186 if (isInfixType(tp)) {
187187 val l :: r :: Nil = args
188188 val opName = tyconName(tycon)
@@ -197,7 +197,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
197197 case OrType (tp1, tp2) =>
198198 return toTextInfixType(tpnme.raw.BAR , tp1, tp2) { toText(tpnme.raw.BAR ) }
199199
200- case EtaExpansion (tycon) if ! ctx.settings. YprintDebug .value =>
200+ case EtaExpansion (tycon) if ! printDebug =>
201201 return toText(tycon)
202202 case tp : RefinedType if defn.isFunctionType(tp) =>
203203 return toTextDependentFunction(tp.refinedInfo.asInstanceOf [MethodType ])
@@ -237,7 +237,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
237237 }
238238 return " [applied to " ~ (Str (" given " ) provided tp.isContextualMethod) ~ (Str (" erased " ) provided tp.isErasedMethod) ~ " (" ~ argsText ~ " ) returning " ~ toText(resultType) ~ " ]"
239239 case IgnoredProto (ignored) =>
240- return " ?" ~ ((" (ignored: " ~ toText(ignored) ~ " )" ) provided ctx.settings.verbose.value )
240+ return " ?" ~ ((" (ignored: " ~ toText(ignored) ~ " )" ) provided printDebug )
241241 case tp @ PolyProto (targs, resType) =>
242242 return " [applied to [" ~ toTextGlobal(targs, " , " ) ~ " ] returning " ~ toText(resType)
243243 case _ =>
@@ -255,7 +255,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
255255 (" {" ~ toText(trees, " \n " ) ~ " }" ).close
256256
257257 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
259259 val (open, close) = if (isQuote) (keywordStr(" '[" ), keywordStr(" ]" )) else (" [" , " ]" )
260260 val funText = toTextLocal(tree.fun).provided(! isQuote)
261261 tree.fun match {
@@ -337,9 +337,9 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
337337 if (name.isTypeName) typeText(txt)
338338 else txt
339339 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(" }" )
341341 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 ))
343343 case tree : This =>
344344 optDotPrefix(tree) ~ keywordStr(" this" ) ~ idText(tree)
345345 case Super (qual : This , mix) =>
@@ -349,9 +349,9 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
349349 changePrec (GlobalPrec ) {
350350 keywordStr(" throw " ) ~ toText(args.head)
351351 }
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 )
353353 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 )
355355 keywordStr(" ${" ) ~ toTextGlobal(args, " , " ) ~ keywordStr(" }" )
356356 else if (app.isGivenApply && ! homogenizedView)
357357 changePrec(InfixPrec ) {
@@ -518,7 +518,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
518518 case EmptyTree =>
519519 " <empty>"
520520 case TypedSplice (t) =>
521- if (ctx.settings. YprintDebug .value ) " [" ~ toText(t) ~ " ]#TS#"
521+ if (printDebug ) " [" ~ toText(t) ~ " ]#TS#"
522522 else toText(t)
523523 case tree @ ModuleDef (name, impl) =>
524524 withEnclosingDef(tree) {
@@ -597,7 +597,7 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
597597 case Splice (tree) =>
598598 keywordStr(" ${" ) ~ toTextGlobal(dropBlock(tree)) ~ keywordStr(" }" )
599599 case tree : Applications .IntegratedTypeArgs =>
600- toText(tree.app) ~ Str (" (with integrated type args)" ).provided(ctx.settings. YprintDebug .value )
600+ toText(tree.app) ~ Str (" (with integrated type args)" ).provided(printDebug )
601601 case Thicket (trees) =>
602602 " Thicket {" ~~ toTextGlobal(trees, " \n " ) ~~ " }"
603603 case _ =>
@@ -775,8 +775,9 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
775775
776776 protected def templateText (tree : TypeDef , impl : Template ): Text = {
777777 val decl = modText(tree.mods, tree.symbol, keywordStr(if ((tree).mods is Trait ) " trait" else " class" ), isType = true )
778- decl ~~ typeText(nameIdText(tree)) ~ withEnclosingDef(tree) { toTextTemplate(impl) } ~
779- (if (tree.hasType && ctx.settings.verbose.value) i " [decls = ${tree.symbol.info.decls}] " else " " )
778+ ( decl ~~ typeText(nameIdText(tree)) ~ withEnclosingDef(tree) { toTextTemplate(impl) }
779+ // ~ (if (tree.hasType && printDebug) i"[decls = ${tree.symbol.info.decls}]" else "") // uncomment to enable
780+ )
780781 }
781782
782783 protected def toTextPackageId [T >: Untyped ](pid : Tree [T ]): Text =
0 commit comments