summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Fraser <george@fivetran.com>2019-01-18 21:19:14 -0800
committerGeorge Fraser <george@fivetran.com>2019-01-18 21:19:14 -0800
commitf9aff76e3825f13e0174806a5b875b3a96f54a78 (patch)
tree33891930c0c4eb82631fa0c89cdf6c5c0a5ea258 /src
parent6de988bcf2de73cda0b97908c089b19255b4fb05 (diff)
downloadjava-language-server-f9aff76e3825f13e0174806a5b875b3a96f54a78.zip
Log start
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/javacs/CompileFile.java7
-rw-r--r--src/main/java/org/javacs/JavaLanguageServer.java2
2 files changed, 2 insertions, 7 deletions
diff --git a/src/main/java/org/javacs/CompileFile.java b/src/main/java/org/javacs/CompileFile.java
index f0d2f86..46029ae 100644
--- a/src/main/java/org/javacs/CompileFile.java
+++ b/src/main/java/org/javacs/CompileFile.java
@@ -4,12 +4,7 @@ import com.sun.source.tree.*;
import com.sun.source.util.*;
import java.io.IOException;
import java.net.URI;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Objects;
-import java.util.Optional;
+import java.util.*;
import java.util.function.Predicate;
import java.util.logging.Logger;
import javax.lang.model.element.*;
diff --git a/src/main/java/org/javacs/JavaLanguageServer.java b/src/main/java/org/javacs/JavaLanguageServer.java
index 65d95dc..a7f93f8 100644
--- a/src/main/java/org/javacs/JavaLanguageServer.java
+++ b/src/main/java/org/javacs/JavaLanguageServer.java
@@ -328,12 +328,12 @@ class JavaLanguageServer extends LanguageServer {
@Override
public Optional<CompletionList> completion(TextDocumentPositionParams position) {
- // TODO reuse previous compilation when changes are small
var started = Instant.now();
var uri = position.textDocument.uri;
if (!FileStore.isJavaFile(uri)) return Optional.empty();
var line = position.position.line + 1;
var column = position.position.character + 1;
+ LOG.info(String.format("Complete at %s(%d,%d)", uri.getPath(), line, column));
// Figure out what kind of completion we want to do
var maybeCtx = compiler.parseFile(uri).completionContext(line, column);
// TODO don't complete inside of comments