diff options
author | George Fraser <george@fivetran.com> | 2019-01-01 20:02:04 -0800 |
---|---|---|
committer | George Fraser <george@fivetran.com> | 2019-01-01 20:02:04 -0800 |
commit | f3faf409445e82cfa12f9993c4075a5523000c0e (patch) | |
tree | 48d9df5fb20ae00b0345d0f941515f8296a2cb8b /src/main/java/org/javacs/JavaLanguageServer.java | |
parent | 280e801d4e529f471fc0631dc880b778815aa394 (diff) | |
download | java-language-server-f3faf409445e82cfa12f9993c4075a5523000c0e.zip |
Error-prone is working but super slow
Diffstat (limited to 'src/main/java/org/javacs/JavaLanguageServer.java')
-rw-r--r-- | src/main/java/org/javacs/JavaLanguageServer.java | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/main/java/org/javacs/JavaLanguageServer.java b/src/main/java/org/javacs/JavaLanguageServer.java index 647f8b4..c9ebb30 100644 --- a/src/main/java/org/javacs/JavaLanguageServer.java +++ b/src/main/java/org/javacs/JavaLanguageServer.java @@ -124,14 +124,7 @@ class JavaLanguageServer extends LanguageServer { } } - void lint(Collection<URI> uris) { - var message = new StringJoiner(", "); - for (var uri : uris) { - var path = uri.getPath(); - var name = Paths.get(path).getFileName(); - message.add(name.toString()); - } - LOG.info("Lint " + message); + void reportErrors(Collection<URI> uris) { var messages = compiler.reportErrors(uris); publishDiagnostics(uris, messages); } @@ -1081,7 +1074,7 @@ class JavaLanguageServer extends LanguageServer { if (needsUpdate.isEmpty()) return; // If there's more than 1 file, report progress - if (needsUpdate.size() > 1) { // TODO this could probably be tuned to be higher + if (needsUpdate.size() > 1) { // TODO this could probably be tuned to be higher and based on bytes of code progress.start(String.format("Index %d files", needsUpdate.size())); } else { progress = ReportProgress.EMPTY; @@ -1162,7 +1155,7 @@ class JavaLanguageServer extends LanguageServer { public CodeLens resolveCodeLens(CodeLens unresolved) { // TODO This is pretty klugey, should happen asynchronously after CodeLenses are shown if (!recentlyOpened.isEmpty()) { - lint(recentlyOpened); + reportErrors(recentlyOpened); recentlyOpened.clear(); } // Unpack data @@ -1448,7 +1441,7 @@ class JavaLanguageServer extends LanguageServer { var uri = params.textDocument.uri; if (isJavaFile(uri)) { // Re-lint all active documents - lint(activeDocuments.keySet()); + reportErrors(activeDocuments.keySet()); } } |