Revert "Set complete flag in completions"

This reverts commit edf43a473b.
This fixes performance regression of tab completion observerd in https://github.com/sbt/sbt/issues/6204
This commit is contained in:
Eugene Yokota 2020-12-19 00:01:16 -05:00
parent 8a6c10327b
commit 76c4ae56f0
1 changed files with 5 additions and 8 deletions

View File

@ -63,14 +63,11 @@ object LineReader {
* `testOnly testOnly\ com.foo.FooSpec` instead of `testOnly com.foo.FooSpec`.
*/
if (c.append.nonEmpty) {
val comp =
if (!pl.line().endsWith(" ")) pl.line().split(" ").last + c.append else c.append
// tell jline to append a " " if the completion would be valid with a " " appended
// which can be the case for input tasks and some commands. We need to exclude
// the empty string and ";" which always seem to be present.
val complete = (Parser.completions(parser, comp + " ", 10).get.map(_.display) --
Set(";", "")).nonEmpty
candidates.add(new Candidate(comp, comp, null, null, null, null, complete))
if (!pl.line().endsWith(" ")) {
candidates.add(new Candidate(pl.line().split(" ").last + c.append))
} else {
candidates.add(new Candidate(c.append))
}
}
}
}