Fix #3161: Don't fail if group is not present

This covers the case described in #1361 plus an esoteric case too.
Parsers are initialized when sbt starts and text completions use the
knowledge at that time. If we happen to move a new file that should
influence the behaviour of the tab completion, that file will not be
picked up. Before, since we were throwing an error, the previous case
that would no produce any tab completion would also fail, though the
files are legitimately in the correct place.
This commit is contained in:
jvican 2017-05-01 23:31:47 +02:00
parent e69436adde
commit 70cf417525
No known key found for this signature in database
GPG Key ID: 42DAFA0F112E8050
2 changed files with 2 additions and 2 deletions

View File

@ -70,7 +70,7 @@ object Scripted {
else dropped.take(pageSize)
}
def nameP(group: String) = {
token("*".id | id.examples(pairMap(group)))
token("*".id | id.examples(pairMap.getOrElse(group, Set.empty[String])))
}
val PagedIds: Parser[Seq[String]] =
for {

View File

@ -99,7 +99,7 @@ object ScriptedPlugin extends AutoPlugin {
else dropped.take(pageSize)
}
def nameP(group: String) = {
token("*".id | id.examples(pairMap(group)))
token("*".id | id.examples(pairMap.getOrElse(group, Set.empty[String])))
}
val PagedIds: Parser[Seq[String]] =
for {