redhat-developer / redhat-developer/vscode-java

Code completion not working

Open
#899 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

content-assist
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

Code completion is all but non-existent when typing in a .java file.

Environment
  • Operating System: macOS Mojave 10.14.4
  • JDK version: 12.0.1
  • Visual Studio Code version: 1.33.1
  • Java extension version: 0.6.0
Steps To Reproduce

n-a

Logs:

Language support for java log:

[Error - 3:01:13 PM] 25 Apr. 2019, 3:01:13 pm Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ls.core".
null
java.lang.NullPointerException
at com.microsoft.java.test.plugin.util.ProjectUtils.lambda$0(ProjectUtils.java:80)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
at com.microsoft.java.test.plugin.util.ProjectUtils.parseProjects(ProjectUtils.java:83)
at com.microsoft.java.test.plugin.util.ProjectUtils.getTestSourcePaths(ProjectUtils.java:63)
at com.microsoft.java.test.plugin.handler.TestDelegateCommandHandler.executeCommand(TestDelegateCommandHandler.java:40)
at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:151)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:141)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$3(JDTLanguageServer.java:439)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$33(JDTLanguageServer.java:835)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)

[Error - 3:01:13 PM] 25 Apr. 2019, 3:01:13 pm Error in calling delegate command handler
null
java.lang.NullPointerException
at com.microsoft.java.test.plugin.util.ProjectUtils.lambda$0(ProjectUtils.java:80)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176)
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
at com.microsoft.java.test.plugin.util.ProjectUtils.parseProjects(ProjectUtils.java:83)
at com.microsoft.java.test.plugin.util.ProjectUtils.getTestSourcePaths(ProjectUtils.java:63)
at com.microsoft.java.test.plugin.handler.TestDelegateCommandHandler.executeCommand(TestDelegateCommandHandler.java:40)
at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:151)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:141)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$3(JDTLanguageServer.java:439)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$33(JDTLanguageServer.java:835)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)

Current Result

Within a .java file, typing "class", amongst others, does not offer any code snippets.

Expected Result

Within a .java file, typing "class" should result in code snippet suggestions, as per https://code.visualstudio.com/docs/java/java-tutorial

Additional Informations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing completion in a .java file and tracing the logged failure at ProjectUtils.java:80 through parseProjects and getTestSourcePaths. Inspect TestDelegateCommandHandler.executeCommand and the org.eclipse.jdt.ls.core call path. Done means typing "class" produces the expected Java snippet suggestions without the reported NullPointerException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.