summaryrefslogtreecommitdiff
path: root/src/main/java/org/javacs/JavaLanguageServer.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/javacs/JavaLanguageServer.java')
-rw-r--r--src/main/java/org/javacs/JavaLanguageServer.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/org/javacs/JavaLanguageServer.java b/src/main/java/org/javacs/JavaLanguageServer.java
index 2d2e3bc..9d5b33d 100644
--- a/src/main/java/org/javacs/JavaLanguageServer.java
+++ b/src/main/java/org/javacs/JavaLanguageServer.java
@@ -641,16 +641,18 @@ class JavaLanguageServer extends LanguageServer {
var el = activeFileCache.element(line, column);
if (!el.isPresent()) return Optional.empty();
- // Add code hover message
var result = new ArrayList<MarkedString>();
- var code = hoverCode(el.get());
- result.add(new MarkedString("java", code));
+
// Add docs hover message
var docs = hoverDocs(el.get());
if (docs.isPresent()) {
- result.add(new MarkedString("markdown", docs.get()));
+ result.add(new MarkedString(docs.get()));
}
+ // Add code hover message
+ var code = hoverCode(el.get());
+ result.add(new MarkedString("java", code));
+
return Optional.of(new Hover(result));
}