summaryrefslogtreecommitdiff
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
parent6de988bcf2de73cda0b97908c089b19255b4fb05 (diff)
downloadjava-language-server-f9aff76e3825f13e0174806a5b875b3a96f54a78.zip
Log start
-rw-r--r--README.md2
-rw-r--r--src/main/java/org/javacs/CompileFile.java7
-rw-r--r--src/main/java/org/javacs/JavaLanguageServer.java2
3 files changed, 3 insertions, 8 deletions
diff --git a/README.md b/README.md
index 96dc276..ec8d7a2 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
A Java [language server](https://github.com/Microsoft/vscode-languageserver-protocol) implemented using the Java compiler API.
-[![CircleCI](https://circleci.com/gh/georgewfraser/java-language-server.svg?style=svg)](https://circleci.com/gh/georgewfraser/java-language-server)
+[![CircleCI](https://circleci.com/gh/georgewfraser/java-language-server.png)](https://circleci.com/gh/georgewfraser/java-language-server)
## Installation
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