Merge pull request #7995 from xuwei-k/using-param-anonymous

This commit is contained in:
eugene yokota 2025-01-01 22:03:16 -05:00 committed by GitHub
commit 2f75863c09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 16 additions and 16 deletions

View File

@ -229,14 +229,14 @@ object Sync {
private def readUncaught[F <: FileInfo](
store: CacheStore
)(using infoFormat: JsonFormat[F]): RelationInfo[F] =
)(using JsonFormat[F]): RelationInfo[F] =
given IsoString[File] = fileIsoString
import PathOnlyFormats.given
store.read(default = (Relation.empty[File, File], Map.empty[File, F]))
private def readUncaughtVirtual[F <: FileInfo](
store: CacheStore
)(using infoFormat: JsonFormat[F]): RelationInfoVirtual[F] = {
)(using JsonFormat[F]): RelationInfoVirtual[F] = {
import sjsonnew.IsoString
given IsoString[VirtualFileRef] =
IsoString.iso[VirtualFileRef](_.toString, VirtualFileRef.of(_))

View File

@ -24,7 +24,7 @@ object InputTaskMacro:
// inputTaskDynMacro0[A1](c)(t)
private def inputTaskMacro0[A1: Type](tree: Expr[A1])(using
qctx: Quotes
Quotes
): Expr[Def.Initialize[InputTask[A1]]] =
// println(s"tree = ${tree.show}")
iInitializeMacro(tree) { et =>

View File

@ -57,7 +57,7 @@ private[sbt] object KeyMacro:
private def errorMsg2: String =
"""project must be directly assigned to a val, such as `val x = project.in(file("core"))`."""
private[sbt] def definingValName(errorMsg: String)(using qctx: Quotes): Expr[String] =
private[sbt] def definingValName(errorMsg: String)(using Quotes): Expr[String] =
val term = enclosingTerm
if term.isValDef then Expr(term.name)
else errorAndAbort(errorMsg)

View File

@ -485,9 +485,9 @@ trait ProjectExtra extends Scoped.Syntax:
)
private[sbt] def relation(settings: Seq[Def.Setting[?]], actual: Boolean)(using
delegates: Scope => Seq[Scope],
scopeLocal: Def.ScopeLocal,
display: Show[ScopedKey[?]]
Scope => Seq[Scope],
Def.ScopeLocal,
Show[ScopedKey[?]]
): Relation[ScopedKey[?], ScopedKey[?]] =
val cMap = Def.flattenLocals(Def.compiled(settings, actual))
val emptyRelation = Relation.empty[ScopedKey[?], ScopedKey[?]]
@ -496,11 +496,11 @@ trait ProjectExtra extends Scoped.Syntax:
}
private[sbt] def showDefinitions(key: AttributeKey[?], defs: Seq[Scope])(using
display: Show[ScopedKey[?]]
Show[ScopedKey[?]]
): String =
showKeys(defs.map(scope => ScopedKey(scope, key)))
private[sbt] def showUses(defs: Seq[ScopedKey[?]])(using display: Show[ScopedKey[?]]): String =
private[sbt] def showUses(defs: Seq[ScopedKey[?]])(using Show[ScopedKey[?]]): String =
showKeys(defs)
private def showKeys(s: Seq[ScopedKey[?]])(using display: Show[ScopedKey[?]]): String =

View File

@ -73,7 +73,7 @@ object Aggregation {
Command.applyEffect(seqParser(ps))(ts => runTasks(s, ts, DummyTaskMap(Nil), show))
private def showRun[A](complete: Complete[A], show: ShowConfig)(using
display: Show[ScopedKey[?]]
Show[ScopedKey[?]]
): Unit =
import complete.*
val log = state.log

View File

@ -988,7 +988,7 @@ private[sbt] object Continuous extends DeprecatedContinuous {
end Config
@nowarn
private def getStartMessage(key: ScopedKey[?])(using e: Extracted): StartMessage = Some {
private def getStartMessage(key: ScopedKey[?])(using Extracted): StartMessage = Some {
lazy val default = key.get(watchStartMessage).getOrElse(Watch.defaultStartWatch)
key.get(deprecatedWatchingMessage).map(Left(_)).getOrElse(Right(default))
}
@ -996,7 +996,7 @@ private[sbt] object Continuous extends DeprecatedContinuous {
@nowarn
private def getTriggerMessage(
key: ScopedKey[?]
)(using e: Extracted): TriggerMessage = {
)(using Extracted): TriggerMessage = {
lazy val default =
key.get(watchTriggeredMessage).getOrElse(Watch.defaultOnTriggerMessage)
key.get(deprecatedTriggeredMessage).map(Left(_)).getOrElse(Right(default))

View File

@ -78,7 +78,7 @@ object FileChangesMacro:
currentKey: Expr[TaskKey[Seq[NioPath]]],
changeKey: Expr[TaskKey[Seq[(NioPath, FileStamp)] => FileChanges]],
mapKey: Expr[TaskKey[Seq[(NioPath, FileStamp)]]],
)(using qctx: Quotes): Expr[FileChanges] =
)(using Quotes): Expr[FileChanges] =
val taskScope = getTaskScope[A](in)
'{
val ts: Scope = $taskScope
@ -98,7 +98,7 @@ object FileChangesMacro:
val ts = getTaskScope[A](in)
'{ rescope[Seq[NioPath]]($ts, allOutputFiles).value }
private def getTaskScope[A: Type](in: Expr[TaskKey[A]])(using qctx: Quotes): Expr[sbt.Scope] =
private def getTaskScope[A: Type](in: Expr[TaskKey[A]])(using Quotes): Expr[sbt.Scope] =
'{
if $in.scope.task.toOption.isDefined then $in.scope
else $in.scope.copy(task = Select($in.key))

View File

@ -90,7 +90,7 @@ private[sbt] object SettingCompletions {
session: SessionSettings,
r: Relation[ScopedKey[?], ScopedKey[?]],
redefined: Seq[Setting[?]],
)(using show: Show[ScopedKey[?]]): SetResult = {
)(using Show[ScopedKey[?]]): SetResult = {
val redefinedKeys = redefined.map(_.key).toSet
val affectedKeys = redefinedKeys.flatMap(r.reverse)
def summary(verbose: Boolean): String = setSummary(redefinedKeys, affectedKeys, verbose)

View File

@ -79,7 +79,7 @@ class EvaluateSettings[I <: Init](
getResults(using delegates)
}
private def getResults(using delegates: ScopeType => Seq[ScopeType]) =
private def getResults(using ScopeType => Seq[ScopeType]) =
static.toTypedSeq.foldLeft(empty) { case (ss, static.TPair(key, node)) =>
if key.key.isLocal then ss
else ss.set(key, node.get)