diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/javacs/JavaLanguageServer.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/org/javacs/JavaLanguageServer.java b/src/main/java/org/javacs/JavaLanguageServer.java index 9d5b33d..cbe92d0 100644 --- a/src/main/java/org/javacs/JavaLanguageServer.java +++ b/src/main/java/org/javacs/JavaLanguageServer.java @@ -32,6 +32,7 @@ import java.util.Optional; import java.util.Set; import java.util.StringJoiner; import java.util.UUID; +import java.util.function.Predicate; import java.util.logging.Logger; import javax.lang.model.element.Element; import javax.lang.model.element.ExecutableElement; @@ -645,9 +646,9 @@ class JavaLanguageServer extends LanguageServer { // Add docs hover message var docs = hoverDocs(el.get()); - if (docs.isPresent()) { - result.add(new MarkedString(docs.get())); - } + docs.filter(Predicate.not(String::isBlank)).ifPresent(doc -> { + result.add(new MarkedString(doc)); + }); // Add code hover message var code = hoverCode(el.get()); |