d2k2
d2k2

Reputation: 712

Javadoc loading slows down Eclipse

Whenever the JavaDoc tooltip is loading while

a) hovering the cursor over an Object

b) or using the code assistant (autocomplete)

it takes up to 1 second until i can continue typing. It does not happen immediately after start, but after using STS/Eclipse for a while. Then i have to restart it again to get rid of the problem.

What i notice aswell is the high CPU usage (25%) even STS is running in background and not beeing used.

STS CPU usage idle

Following errors have been logged:

java.lang.InterruptedException
        at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:347)
        at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1915)
        at org.springframework.tooling.boot.ls.jdt.LSPTextHover.getHoverInfo(LSPTextHover.java:109)
        at org.springframework.tooling.boot.ls.jdt.SpringBootJavaHoverProvider.getHoverInfo2(SpringBootJavaHoverProvider.java:42)
        at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:167)
        at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:133)
        at org.eclipse.jdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy.getHoverInfo2(JavaEditorTextHoverProxy.java:89)
        at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:169)



!ENTRY org.eclipse.jface.text 4 0 2019-09-24 11:14:07.629
!MESSAGE Unexpected runtime error while computing a text hover
!STACK 0
java.lang.NullPointerException
        at org.eclipse.jdt.internal.compiler.lookup.UnresolvedAnnotationBinding.resolve(UnresolvedAnnotationBinding.java:34)
        at org.eclipse.jdt.internal.compiler.lookup.UnresolvedAnnotationBinding.getAnnotationType(UnresolvedAnnotationBinding.java:41)
        at org.eclipse.jdt.core.dom.MethodBinding.filterTypeAnnotations(MethodBinding.java:227)
        at org.eclipse.jdt.core.dom.MethodBinding.getAnnotations(MethodBinding.java:116)
        at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getAnnotations(JavadocHover.java:1192)
        at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.addAnnotations(JavadocHover.java:1149)
        at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo(JavadocHover.java:757)
        at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.internalGetHoverInfo(JavadocHover.java:678)
        at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo2(JavadocHover.java:670)
        at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:167)
        at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:133)
        at org.eclipse.jdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy.getHoverInfo2(JavaEditorTextHoverProxy.java:89)
        at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:169)

What i have tried already:

I disabled already the "Combined Hover" under "Preferences/Java/Editor/Hovers" which solved problem a).

I enabled under "Preferences/Maven/Download Artifact Javadoc". All Javadocs should be available offline and thus load extremly fast. But they are loading slow.

The constant freezing/loading while typing and using the code assitant is still annoying.

Is there a way to disable the javadoc for the content assistant? Or is there any workaround to speed up the JavaDoc loading time? I have no explanation why it takes so much time to show up the javadoc tooltip. Where is it loaded from? If its loaded offline it should load fast.

I am using STS v4.4 which is based on Eclipse Platform v4.13.0 with OpenJ9 JDK11.

Upvotes: 0

Views: 444

Answers (1)

d2k2
d2k2

Reputation: 712

It seems like the Language Server is slowing down the code completion. I disabled the Language Server under "Preferences / Language Servers". The freezing while typing is gone.

I will make a bug report once i can 100% confirm this is the reason for the freezing.

Upvotes: 1

Related Questions