summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorGeorge Fraser <george@fivetran.com>2019-01-18 21:55:54 -0800
committerGeorge Fraser <george@fivetran.com>2019-01-18 21:55:54 -0800
commit32123abda7097d14b1a326e6e9bee52d9ae94761 (patch)
treeb880a95a1a808c910b31d198e050b7f99d6b6d0f /src/main
parenta4e990d2ca941934717ac899b66d5442b66e8b29 (diff)
downloadjava-language-server-32123abda7097d14b1a326e6e9bee52d9ae94761.zip
Polish logs
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/javacs/Docs.java2
-rw-r--r--src/main/java/org/javacs/ParseFile.java2
-rw-r--r--src/main/java/org/javacs/Profiler.java12
-rw-r--r--src/main/java/org/javacs/lsp/LSP.java3
4 files changed, 15 insertions, 4 deletions
diff --git a/src/main/java/org/javacs/Docs.java b/src/main/java/org/javacs/Docs.java
index 07c81e2..586d3f9 100644
--- a/src/main/java/org/javacs/Docs.java
+++ b/src/main/java/org/javacs/Docs.java
@@ -46,7 +46,7 @@ public class Docs {
fileManager.getJavaFileForInput(
StandardLocation.SOURCE_PATH, className, JavaFileObject.Kind.SOURCE);
if (fromSourcePath != null) {
- LOG.info(String.format("...found %s on source path", fromSourcePath.toUri()));
+ LOG.info(String.format("...found %s on source path", fromSourcePath.toUri().getPath()));
return Optional.of(fromSourcePath);
}
for (var module : Classes.JDK_MODULES) {
diff --git a/src/main/java/org/javacs/ParseFile.java b/src/main/java/org/javacs/ParseFile.java
index b37a3b6..33521ed 100644
--- a/src/main/java/org/javacs/ParseFile.java
+++ b/src/main/java/org/javacs/ParseFile.java
@@ -135,7 +135,7 @@ public class ParseFile {
LOG.info(
String.format(
"Finding completion position near %s(%d,%d)...",
- root.getSourceFile().toUri(), line, character));
+ root.getSourceFile().toUri().getPath(), line, character));
var pos = trees.getSourcePositions();
var lines = root.getLineMap();
diff --git a/src/main/java/org/javacs/Profiler.java b/src/main/java/org/javacs/Profiler.java
index e9c3635..abe57c2 100644
--- a/src/main/java/org/javacs/Profiler.java
+++ b/src/main/java/org/javacs/Profiler.java
@@ -45,8 +45,16 @@ class Profiler implements TaskListener {
var s = elapsed.getSeconds() + elapsed.getNano() / 1000.0 / 1000.0 / 1000.0;
lines.add(String.format("%s: %.3fs", kind, s));
}
- // TODO log names if n is small
- LOG.info(String.format("Compiled %d files: %s", files.size(), lines));
+ // If n is small, print each file name
+ if (files.size() <= 3) {
+ var names = new StringJoiner(", ");
+ for (var f : files) {
+ names.add(Parser.fileName(f));
+ }
+ LOG.info(String.format("...compiled %s: %s", names, lines));
+ } else {
+ LOG.info(String.format("...compiled %d files: %s", files.size(), lines));
+ }
}
private static final Logger LOG = Logger.getLogger("main");
diff --git a/src/main/java/org/javacs/lsp/LSP.java b/src/main/java/org/javacs/lsp/LSP.java
index 4458ab9..cbd85cf 100644
--- a/src/main/java/org/javacs/lsp/LSP.java
+++ b/src/main/java/org/javacs/lsp/LSP.java
@@ -416,6 +416,9 @@ public class LSP {
respond(send, r.id, response);
break;
}
+ case "$/cancelRequest":
+ // Already handled in peek(message)
+ break;
default:
LOG.warning(String.format("Don't know what to do with method `%s`", r.method));
}