In 'set' command, handle keys in new scopes in the affected settings part

This commit is contained in:
Mark Harrah 2013-05-09 17:13:22 -04:00
parent 7ed56d3fcd
commit e1acc12290
2 changed files with 7 additions and 3 deletions

View File

@ -319,10 +319,13 @@ object Project extends ProjectExtra
val keyToString = display.apply _ val keyToString = display.apply _
DotGraph.generateGraph(file, graphName, rel, keyToString, keyToString) DotGraph.generateGraph(file, graphName, rel, keyToString, keyToString)
} }
def relation(structure: BuildStructure, actual: Boolean)(implicit display: Show[ScopedKey[_]]) = def relation(structure: BuildStructure, actual: Boolean)(implicit display: Show[ScopedKey[_]]): Relation[ScopedKey[_], ScopedKey[_]] =
relation(structure.settings, actual)(structure.delegates, structure.scopeLocal, display)
private[sbt] def relation(settings: Seq[Setting[_]], actual: Boolean)(implicit delegates: Scope => Seq[Scope], scopeLocal: Def.ScopeLocal, display: Show[ScopedKey[_]]): Relation[ScopedKey[_], ScopedKey[_]] =
{ {
type Rel = Relation[ScopedKey[_], ScopedKey[_]] type Rel = Relation[ScopedKey[_], ScopedKey[_]]
val cMap = Def.flattenLocals(Def.compiled(structure.settings, actual)(structure.delegates, structure.scopeLocal, display)) val cMap = Def.flattenLocals(Def.compiled(settings, actual))
((Relation.empty: Rel) /: cMap) { case (r, (key, value)) => ((Relation.empty: Rel) /: cMap) { case (r, (key, value)) =>
r + (key, value.dependencies) r + (key, value.dependencies)
} }

View File

@ -49,8 +49,9 @@ private[sbt] object SettingCompletions
{ {
import extracted._ import extracted._
val append = Load.transformSettings(Load.projectScope(currentRef), currentRef.build, rootProject, settings) val append = Load.transformSettings(Load.projectScope(currentRef), currentRef.build, rootProject, settings)
val r = relation(extracted.structure, true)
val newSession = session.appendSettings( append map (a => (a, arg.split('\n').toList))) val newSession = session.appendSettings( append map (a => (a, arg.split('\n').toList)))
val struct = extracted.structure
val r = relation(newSession.mergeSettings, true)(structure.delegates, structure.scopeLocal, implicitly)
setResult(newSession, r, append) setResult(newSession, r, append)
} }