Add project id to watching message

We redefine watchingMessage in project scope so we can use
thisProjectRef to make the watching message more precise.

Fixes #2038
This commit is contained in:
Dale Wijnand
2017-12-15 01:49:14 +00:00
parent 3d45f82e75
commit 5f0852818b
4 changed files with 22 additions and 4 deletions
@@ -44,8 +44,13 @@ trait Watched {
}
object Watched {
val defaultWatchingMessage
: WatchState => String = _.count + ". Waiting for source changes... (press enter to interrupt)"
val defaultWatchingMessage: WatchState => String = ws =>
s"${ws.count}. Waiting for source changes... (press enter to interrupt)"
def projectWatchingMessage(projectId: String): WatchState => String =
ws =>
s"${ws.count}. Waiting for source changes in project $projectId... (press enter to interrupt)"
val defaultTriggeredMessage: WatchState => String = const("")
val clearWhenTriggered: WatchState => String = const(clearScreen)
def clearScreen: String = "\u001b[2J\u001b[0;0H"
@@ -70,8 +75,8 @@ object Watched {
* @param base The base directory from which to include files.
* @return An instance of `Source`.
*/
def apply(base: File): Source =
apply(base, AllPassFilter, NothingFilter)
def apply(base: File): Source = apply(base, AllPassFilter, NothingFilter)
}
private[this] class AWatched extends Watched