summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-01-21 17:36:58 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2018-01-21 17:36:58 -0800
commit3e80ade3249bc83b564d7b5bd31853c8affd555d (patch)
treeaef1f790d16da2cfac9afd07bca4f3e53b364811 /core
parent68f158b63c33aa7312ba4b715f6b18527453b761 (diff)
downloadmill-3e80ade3249bc83b564d7b5bd31853c8affd555d.tar.gz
mill-3e80ade3249bc83b564d7b5bd31853c8affd555d.tar.bz2
mill-3e80ade3249bc83b564d7b5bd31853c8affd555d.zip
Give `mill.Module` a useful default `toString`, and make the REPLs pprint work for non-top-level modules
Diffstat (limited to 'core')
-rw-r--r--core/src/mill/define/Module.scala1
-rw-r--r--core/src/mill/main/ReplApplyHandler.scala2
2 files changed, 2 insertions, 1 deletions
diff --git a/core/src/mill/define/Module.scala b/core/src/mill/define/Module.scala
index c68c2bdd..1be75e1d 100644
--- a/core/src/mill/define/Module.scala
+++ b/core/src/mill/define/Module.scala
@@ -29,6 +29,7 @@ class Module(implicit outerCtx0: mill.define.Ctx) extends mill.moduledefs.Cacher
implicit def millModuleSegments: Segments = {
millOuterCtx.segments ++ Seq(millOuterCtx.segment)
}
+ override def toString = millModuleSegments.render
}
object Module{
diff --git a/core/src/mill/main/ReplApplyHandler.scala b/core/src/mill/main/ReplApplyHandler.scala
index 97efb6e5..cc4d3c64 100644
--- a/core/src/mill/main/ReplApplyHandler.scala
+++ b/core/src/mill/main/ReplApplyHandler.scala
@@ -75,7 +75,7 @@ class ReplApplyHandler(pprinter0: pprint.PPrinter,
"\n (" + x._1.map(pprint.PPrinter.BlackWhite.apply(_)).mkString(", ") + ")"
)
)
- case m: mill.Module if evaluator.rootModule.millModuleDirectChildren.contains(m) =>
+ case m: mill.Module if evaluator.rootModule.millInternal.modules.contains(m) =>
pprint.Tree.Lazy( ctx =>
Iterator(m.millInternal.millModuleEnclosing, ":", m.millInternal.millModuleLine.toString) ++
(if (m.millInternal.reflect[mill.Module].isEmpty) Nil