diff options
author | Som Snytt <som.snytt@gmail.com> | 2016-09-30 10:01:47 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2016-09-30 10:01:47 -0700 |
commit | 16c95a8bba0deea5ed8d8e29f1d7b7f447946164 (patch) | |
tree | 48c3d0e039f462b25ec9475bbcc960dd83c7dd1a | |
parent | 1e156450866b75953b4d650df08e9bab9e638d03 (diff) | |
download | scala-16c95a8bba0deea5ed8d8e29f1d7b7f447946164.tar.gz scala-16c95a8bba0deea5ed8d8e29f1d7b7f447946164.tar.bz2 scala-16c95a8bba0deea5ed8d8e29f1d7b7f447946164.zip |
Don't clip descrip when -Ydebug
-Ydebug is supposed to show everything about the phases,
including full description (if otherwise clipped) and
any phases that are not "enabled" by options.
-rw-r--r-- | src/compiler/scala/tools/nsc/Global.scala | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index f151ad70c5..64ed687c07 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -676,7 +676,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter) } /** A description of the phases that will run in this configuration, or all if -Ydebug. */ - def phaseDescriptions: String = phaseHelp("description", elliptically = true, phasesDescMap) + def phaseDescriptions: String = phaseHelp("description", elliptically = !settings.debug, phasesDescMap) /** Summary of the per-phase values of nextFlags and newFlags, shown under -Xshow-phases -Ydebug. */ def phaseFlagDescriptions: String = { @@ -687,7 +687,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter) else if (ph.phaseNewFlags != 0L && ph.phaseNextFlags != 0L) fstr1 + " " + fstr2 else fstr1 + fstr2 } - phaseHelp("new flags", elliptically = false, fmt) + phaseHelp("new flags", elliptically = !settings.debug, fmt) } /** Emit a verbose phase table. @@ -699,7 +699,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter) * @param elliptically whether to truncate the description with an ellipsis (...) * @param describe how to describe a component */ - def phaseHelp(title: String, elliptically: Boolean, describe: SubComponent => String) = { + private def phaseHelp(title: String, elliptically: Boolean, describe: SubComponent => String): String = { val Limit = 16 // phase names should not be absurdly long val MaxCol = 80 // because some of us edit on green screens val maxName = phaseNames map (_.length) max @@ -714,13 +714,13 @@ class Global(var currentSettings: Settings, var reporter: Reporter) // built-in string precision merely truncates import java.util.{ Formattable, FormattableFlags, Formatter } def dotfmt(s: String) = new Formattable { - def elliptically(s: String, max: Int) = ( + def foreshortened(s: String, max: Int) = ( if (max < 0 || s.length <= max) s else if (max < 4) s.take(max) else s.take(max - 3) + "..." ) override def formatTo(formatter: Formatter, flags: Int, width: Int, precision: Int) { - val p = elliptically(s, precision) + val p = foreshortened(s, precision) val w = if (width > 0 && p.length < width) { import FormattableFlags.LEFT_JUSTIFY val leftly = (flags & LEFT_JUSTIFY) == LEFT_JUSTIFY @@ -746,7 +746,7 @@ class Global(var currentSettings: Settings, var reporter: Reporter) else (p.phaseName, describe(p)) fmt.format(name, idOf(p), text) } - line1 :: line2 :: (phaseDescriptors map mkText) mkString + (line1 :: line2 :: (phaseDescriptors map mkText)).mkString } /** Returns List of (phase, value) pairs, including only those |