add query completion

We are using ANTLR listeners to find out where in the
query the cursor is. Then we generate a list of keys/values
that might fit at that position. With that information we
can generate new queries and sort them by the number
of results they yield.
This commit is contained in:
2017-04-17 16:25:14 +02:00
parent f6a9fc2394
commit bcb2e6ca83
10 changed files with 396 additions and 33 deletions

View File

@@ -5,7 +5,6 @@ import java.nio.file.Path;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
@@ -190,9 +189,7 @@ public class PerformanceDb implements AutoCloseable {
public List<Proposal> autocomplete(final String query, final int caretIndex) {
// TODO implement proposals
// return db.proposeTagForQuery(query, caretIndex);
return Collections.emptyList();
return db.propose(query, caretIndex);
}
public List<String> getFields() {