question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Code completion in Java Language Server is not working

See original GitHub issue

When I open my java project the language server is loaded correctly but when I start editing code completion does not work. Cleaning the Java Language Server workspace does not help. The following exception is raised by the language server.

!ENTRY org.eclipse.jdt.ls.core 4 2 2021-04-16 13:57:00.647
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ls.core".
!STACK 0
java.lang.NoSuchMethodError: 'org.eclipse.lsp4j.TextEdit org.eclipse.lsp4j.CompletionItem.getTextEdit()'
	at com.microsoft.jdtls.intellicode.core.vscode.VSCodeCompletionItem.<init>(VSCodeCompletionItem.java:76)
	at com.microsoft.jdtls.intellicode.core.CommandHandler.lambda$0(CommandHandler.java:64)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654)
	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.jdtls.intellicode.core.CommandHandler.executeCommand(CommandHandler.java:64)
Environment
  • Operating System: Ubuntu 20.04.2 LTS
  • JDK version: openjdk 11.0.7 2020-04-14
  • Visual Studio Code version: VSCodium 1.55.2
  • Java extension version: v0.77.0
Steps To Reproduce
  1. Open a java project in VSCodium
  2. Start editing a java file.

Full language server logs: https://gist.github.com/zguesmi/619d2871dc4ff27e1203b888a8592e06

Current Result

The code completion does not work.

Expected Result

The code completion should be working.

Additional Informations

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
testforstephencommented, Jun 5, 2021

yes, since it’s fixed, we could close it.

0reactions
zguesmicommented, Jun 4, 2021

@testforstephen should we close this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSCode not suggesting and autocompleting java code
Open VScode and go to Preferences -> Settings; Search java.configuration.runtimes; Select Edit in settings.json and paste the follwing: "java.
Read more >
Code-completion not working with Language Support for Java ...
VScode fails to show code-completion on fields. This happens if Language Support for Java and Visual Studio IntelliCode - Preview are installed ...
Read more >
IntelliSense in Visual Studio Code
VS Code IntelliSense offers different types of completions, including language server suggestions, snippets, and simple word based textual completions.
Read more >
Java on Visual Studio Code Update – March 2022
Regarding the code completion, one of the top issues is that when writing a constructor in VS Code, developers expect that the suggestion...
Read more >
Language Server
Language Maintainer Repository Ada AdaCore github.com/AdaCore/ada_language_server ANTLR Ken Domino github.com/kaby76/AntlrVSIX Apache Camel Camel Tooling github.com/camel‑tooling/camel‑language‑server
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found