Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception on "class extends XXX" autocompletion #161

Closed
gian1200 opened this issue Jun 28, 2023 · 8 comments · Fixed by eclipse/lsp4mp#412
Closed

Exception on "class extends XXX" autocompletion #161

gian1200 opened this issue Jun 28, 2023 · 8 comments · Fixed by eclipse/lsp4mp#412
Assignees
Labels
bug Something isn't working
Milestone

Comments

@gian1200
Copy link

Got the following error when trying to get suggestions for classes to extend.

image

image

jun. 28, 2023 10:51:21 A.�M. org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
SEVERE: Internal error: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
	at jdk.internal.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	... 11 more
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.lsp4mp.services.properties.CompletionData.getUri()" because the return value of "org.eclipse.lsp4mp.services.properties.CompletionData.getCompletionData(org.eclipse.lsp4j.CompletionItem)" is null
	at org.eclipse.lsp4mp.ls.MicroProfileTextDocumentService.resolveCompletionItem(MicroProfileTextDocumentService.java:156)
	... 15 more

[Error - 10:51:21 AM] Request completionItem/resolve failed.
  Message: Internal error.
  Code: -32603 
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
	at jdk.internal.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	... 11 more
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.lsp4mp.services.properties.CompletionData.getUri()" because the return value of "org.eclipse.lsp4mp.services.properties.CompletionData.getCompletionData(org.eclipse.lsp4j.CompletionItem)" is null
	at org.eclipse.lsp4mp.ls.MicroProfileTextDocumentService.resolveCompletionItem(MicroProfileTextDocumentService.java:156)
	... 15 more

Additional information:

  • OS: Windows 11 Enterprise, 22H2
  • VSCode version: 1.79.2
  • Tools for MicroProfile version: 0.8.0
@angelozerr
Copy link
Contributor

@datho7561 have you some idea about this problem?

@datho7561
Copy link
Contributor

This seems to be similar to eclipse/lsp4mp#402. I think it's probably the same root cause. The completion item should not appear at all.

As for why completion resolve is failing, I don't know.

@fbricon fbricon added the bug Something isn't working label Jul 12, 2023
@angelozerr
Copy link
Contributor

@datho7561 if you have an empty class and you open completion, rest_class appears which is correct andyou have the same error popup.

LSP4MP consider that all completions items contains a data at https://github.com/eclipse/lsp4mp/blob/64c176df2c53eb4a8059ea40dfeecae134c603bb/microprofile.ls/org.eclipse.lsp4mp.ls/src/main/java/org/eclipse/lsp4mp/ls/MicroProfileTextDocumentService.java#L156 which is wrong for snippet.

We need to check that here. Are you ok with that? Do you think you could have time to fix it. It is a really annoying bug.

@datho7561
Copy link
Contributor

Okay, I can take a look into it

@datho7561 datho7561 self-assigned this Jul 12, 2023
@datho7561 datho7561 moved this to 📋 Backlog in IDE Cloudaptors Jul 12, 2023
@angelozerr
Copy link
Contributor

Thanks @datho7561 !

@datho7561
Copy link
Contributor

Hey @JessicaJHee if you comment on this issue, I can assign you, to reflect that you contributed the fix

@JessicaJHee
Copy link
Contributor

Worked on this issue

@angelozerr
Copy link
Contributor

Fixed with eclipse/lsp4mp#412

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants