diff --git a/main-settings/src/main/scala/sbt/Scope.scala b/main-settings/src/main/scala/sbt/Scope.scala index 80661eb6b..4ca49b94d 100644 --- a/main-settings/src/main/scala/sbt/Scope.scala +++ b/main-settings/src/main/scala/sbt/Scope.scala @@ -24,6 +24,11 @@ final case class Scope(project: ScopeAxis[Reference], def in(project: Reference): Scope = copy(project = Select(project)) def in(config: ConfigKey): Scope = copy(config = Select(config)) def in(task: AttributeKey[_]): Scope = copy(task = Select(task)) + + override def toString: String = { + if (extra == This) s"$project / $config / $task" + else s"Scope($project, $config, $task, $extra)" + } } object Scope { val ThisScope: Scope = Scope(This, This, This, This) diff --git a/main-settings/src/main/scala/sbt/Structure.scala b/main-settings/src/main/scala/sbt/Structure.scala index 247b776d4..da963325e 100644 --- a/main-settings/src/main/scala/sbt/Structure.scala +++ b/main-settings/src/main/scala/sbt/Structure.scala @@ -34,6 +34,8 @@ sealed abstract class SettingKey[T] val key: AttributeKey[T] + override def toString: String = s"SettingKey($scope / $key)" + final def toTask: Initialize[Task[T]] = this apply inlineTask final def scopedKey: ScopedKey[T] = ScopedKey(scope, key) @@ -105,6 +107,8 @@ sealed abstract class TaskKey[T] val key: AttributeKey[Task[T]] + override def toString: String = s"TaskKey($scope / $key)" + def toTask: Initialize[Task[T]] = this def scopedKey: ScopedKey[Task[T]] = ScopedKey(scope, key) @@ -172,6 +176,8 @@ sealed trait InputKey[T] val key: AttributeKey[InputTask[T]] + override def toString: String = s"InputKey($scope / $key)" + def scopedKey: ScopedKey[InputTask[T]] = ScopedKey(scope, key) def in(scope: Scope): InputKey[T] = diff --git a/main/src/main/scala/sbt/SlashSyntax.scala b/main/src/main/scala/sbt/SlashSyntax.scala index 634a86b75..bf353f0ae 100644 --- a/main/src/main/scala/sbt/SlashSyntax.scala +++ b/main/src/main/scala/sbt/SlashSyntax.scala @@ -97,6 +97,10 @@ object SlashSyntax { final class ScopeAndKey[K <: Key[K]](scope: Scope, key: K) { private[sbt] def materialize: K = key in scope private[sbt] def rescope: TerminalScope = new TerminalScope(scope in key.key) + + override def toString: String = { + s"$scope / ${key.key}" + } } }