redhat-developer / eclipseide-jdtls

A language server client for Eclipse using JDT-LS
MIT License
11 stars 5 forks source link

Some operations (hover, link...) failing for external files #102

Closed mickaelistria closed 1 year ago

mickaelistria commented 1 year ago

Let's make sure issue is not already fixed in snapshots first.

Steps to reproduce

From a fresh installation and clean workspace:

I tried

I expected: hover doc

But got: nothing

Here is some relevant log output form (<workspace>/.metadata/.log)

Log communication with JDT-LS mentions an error

{"jsonrpc":"2.0","id":"306","error":{"code":-32603,"message":"Internal error.","data":"java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke \"org.eclipse.jdt.core.IType.getClassFile()\" because \"type\" is null\n\tat java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)\n\tat java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)\n\tat java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649)\n\tat java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)\n\tat java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)\n\tat java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)\n\tat java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)\n\tat java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)\n\tat java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)\nCaused by: java.lang.NullPointerException: Cannot invoke \"org.eclipse.jdt.core.IType.getClassFile()\" because \"type\" is null\n\tat org.eclipse.jdt.ls.core.internal.JDTUtils.getClassFile(JDTUtils.java:492)\n\tat org.eclipse.jdt.ls.core.internal.JDTUtils.discardClassFileWorkingCopy(JDTUtils.java:478)\n\tat org.eclipse.jdt.ls.core.internal.handlers.HoverHandler.hover(HoverHandler.java:51)\n\tat org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$5(JDTLanguageServer.java:663)\n\tat org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87)\n\tat java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)\n\t... 6 more\n"}}

Tested under this environment:

Community

mickaelistria commented 1 year ago

This was fixed on LS end with https://github.com/eclipse-jdtls/eclipse.jdt.ls/commit/4769cd9070a6761cf5a483cd06881d5fd4b5a218