diff options
author | George Fraser <george@fivetran.com> | 2019-01-05 21:55:16 -0800 |
---|---|---|
committer | George Fraser <george@fivetran.com> | 2019-01-05 21:55:16 -0800 |
commit | c4ad50a74ac99ea48424be120d1c369b9f1d24e0 (patch) | |
tree | a6a430aa05f1d9aca33c31db73c29e5d76abc6f0 /src/main/java/org/javacs/JavaLanguageServer.java | |
parent | 69ee31525a2be65254aafec0b5bf2d959e1a9b84 (diff) | |
download | java-language-server-c4ad50a74ac99ea48424be120d1c369b9f1d24e0.zip |
Minor fixes
Diffstat (limited to 'src/main/java/org/javacs/JavaLanguageServer.java')
-rw-r--r-- | src/main/java/org/javacs/JavaLanguageServer.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/javacs/JavaLanguageServer.java b/src/main/java/org/javacs/JavaLanguageServer.java index af8ba41..86fb7cc 100644 --- a/src/main/java/org/javacs/JavaLanguageServer.java +++ b/src/main/java/org/javacs/JavaLanguageServer.java @@ -110,6 +110,9 @@ class JavaLanguageServer extends LanguageServer { d.range = new Range(start, end); d.code = j.getCode(); d.message = j.getMessage(null); + if (j.getCode().equals("unused")) { + d.tags = List.of(DiagnosticTag.Unnecessary); + } // Add to byUri var ds = byUri.computeIfAbsent(uri, __ -> new ArrayList<>()); ds.add(d); @@ -341,6 +344,7 @@ 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 (!isJavaFile(uri)) return Optional.empty(); @@ -1019,7 +1023,7 @@ class JavaLanguageServer extends LanguageServer { String title; if (count == -1) title = "? references"; else if (count == 1) title = "1 reference"; - else if (count == 100) title = "Many references"; + else if (count == 100) title = "Find references"; else title = String.format("%d references", count); var arguments = new JsonArray(); arguments.add(uri.toString()); |